android:layout_marginRight="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="密 码:"
android:textSize="20dp" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:password="true" />
</LinearLayout>
</LinearLayout>
------解决方案--------------------或者点击 Project -> Clean 然后再 Run As
------解决方案--------------------一般只需要顶层地Layout需要xmlns:android="http://schemas.android.com/apk/res/android" 属性。
其他的Layout去掉该xmlns属性。
------解决方案--------------------
去除中间两个LinearLayout 的xmlns:android属性
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="20dp" android:layout_marginRight="20dp"> <TextView android:layout_width="wrap_content" android:text="用户名:" android:textSize="20dp" android:layout_height="wrap_content" /> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="20dp" android:layout_marginRight="20dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="密 码:" android:textSize="20dp" /> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:password="true" /> </LinearLayout> </LinearLayout>