Android 未找到属性';重量';包装内';安卓';?
我在编译时一直遇到这个错误:在包“android”中找不到属性“weight”的资源标识符。我怎样才能解决这个问题?代码:Android 未找到属性';重量';包装内';安卓';?,android,xml,Android,Xml,我在编译时一直遇到这个错误:在包“android”中找不到属性“weight”的资源标识符。我怎样才能解决这个问题?代码: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:text="@string/enter_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:hint="@string/hint_one"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:weight="1"
/>
<EditText
android:hint="@string/hint_two"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:weight="1"
/>
<Button
android:text="@string/send_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
是
android:layout\u weight=“1”
是android:layout\u weight=“1”
谢谢!如果你不介意的话,还有一个问题吗?为什么“编辑文本”不会出现?但是,按钮和文本视图会显示。布局权重仅适用于线性布局内部。这是一个相对长度,因此如果您指定高度或宽度0dp,这是您将获得的实际尺寸,重量将忽略Hanks!如果你不介意的话,还有一个问题吗?为什么“编辑文本”不会出现?但是,按钮和文本视图会显示。布局权重仅适用于线性布局内部。这是一个相对值,因此,如果指定高度或宽度0dp,则将得到实际尺寸,而重量将被忽略