【发布时间】:2017-01-02 18:00:44
【问题描述】:
每次我添加小部件或东西时,总会出现以下异常,所以我什至无法运行我的项目。是什么导致了这个问题?解决办法是什么?我是 Android Studio 的新手,希望你们能帮助我。你的每一个回答都是我的荣幸。谢谢!
这是我的 Layout.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.leeroyld.testproject.MainActivity">
<Button
android:text="@string/LoginButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button"
android:layout_marginBottom="79dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@android:color/background_dark"
android:backgroundTint="@android:drawable/bottom_bar"
android:textColor="@android:color/background_light" />
<TextView
android:text="@string/LoginLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/EmailDisplay"
android:textSize="24sp"
android:layout_below="@+id/textView"
android:layout_alignParentStart="true"
android:layout_marginTop="36dp" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="@+id/PasswordInput"
tools:ignore="LabelFor"
android:layout_marginBottom="42dp"
android:layout_above="@+id/button"
android:layout_centerHorizontal="true"
android:background="?attr/actionModeBackground" />
<TextView
android:text="@string/PasswordLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/PasswordDisplay"
android:textSize="24sp"
android:layout_centerVertical="true"
android:layout_alignParentStart="true" />
<TextView
android:text="@string/TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:textSize="24sp"
android:layout_marginTop="31dp"
android:background="@android:drawable/button_onoff_indicator_on"
android:backgroundTint="@android:drawable/alert_light_frame"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="@+id/EmailInput"
tools:ignore="LabelFor"
android:layout_marginTop="24dp"
android:background="?attr/actionModeBackground"
android:layout_below="@+id/EmailDisplay"
android:layout_alignStart="@+id/PasswordInput" />
</RelativeLayout>
【问题讨论】:
-
请发布您的布局。
-
我刚刚更新了它。希望你看到它
-
没有。布局文件。切换到文本选项卡并从那里粘贴代码。
-
我已经发过了
-
查看我的答案。
标签: android android-studio rendering