【问题标题】:Android Studio Layout Design editor problemAndroid Studio Layout Design 编辑器问题
【发布时间】:2019-02-21 14:15:49
【问题描述】:

布局设计编辑器没有响应。当我将任何东西拖到设计布局时,它会移动到左上角,点击它就会消失。

enter image description here

<TextView
    android:id="@+id/textView"
    android:textColor="Solid White"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="8dp"
    android:layout_marginTop="8dp"
    android:layout_marginEnd="8dp"
    android:layout_marginBottom="8dp"
    android:text="@string/TextView"
    android:textSize="20sp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

在此处输入代码

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">


</android.support.constraint.ConstraintLayout>

【问题讨论】:

  • 请告诉我如何处理这个问题
  • 您的文本视图旁边有一个黄色警告 - 您需要解决一个问题。点击右上角的黄色警告,错误信息是什么意思?
  • 现在我已经删除了警告......但同样的问题仍然存在 -Michael Dodd
  • 您可以添加您的布局 XML 代码as an edit to your question 作为文本吗?
  • 现在看看请先生

标签: android android-layout design-patterns


【解决方案1】:

您正在尝试使用无效的颜色值。上线:

android:textColor="Solid White"

Solid White 不是有效的资源名称。您要么需要使用十六进制值,例如

android:textColor="#ffffff"

或颜色资源,例如

android:textColor="@android:color/white"

【讨论】:

  • 很抱歉,同样的问题仍然存在。
  • 在哪种情况下可以编辑您的问题以包含 XML 文件的全部内容?可能还有其他错误。
  • 现在看看我亲爱的朋友
猜你喜欢
  • 2018-04-10
  • 2021-10-07
  • 1970-01-01
  • 1970-01-01
  • 2019-10-04
  • 1970-01-01
  • 1970-01-01
  • 2018-12-29
  • 1970-01-01
相关资源
最近更新 更多