Android 属性缺少命名空间前缀
我刚刚开始学习Android apk编程,遇到了这样一个问题:“属性缺少名称空间前缀”。Android 属性缺少命名空间前缀,android,xml,Android,Xml,我刚刚开始学习Android apk编程,遇到了这样一个问题:“属性缺少名称空间前缀”。 我怎样才能解决这个问题?请回复。。任何回复都很好,谢谢问题在于间距。试试这个 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com
我怎样才能解决这个问题?请回复。。任何回复都很好,谢谢问题在于间距。试试这个
<?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:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="top">
<TextViewandroid:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText
android:id="@+id/entry"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label"/>
<Button
android:id="@+id/ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dip"
android:text="OK" />
<Button
android:layout_alignTop="@id/ok"
android:text="Cancel"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toLeftOf="@+id/ok"
android:layout_below="@+id/entry"/>
</RelativeLayout>
更改:
<?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:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="top">
<TextView android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText
android:id="@+id/entry"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/label"/>
<Button
android:id="@+id/ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dip"
android:text="OK" />
<Button
android:layout_alignTop="@id/ok"
android:text="Cancel"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toLeftOf="@+id/ok"
android:layout_below="@+id/entry"/>
</RelativeLayout>
致:
u shud在小部件名称后提供一些空格。替换下面的代码,它将正常工作
TextView android:id="@+id/label"
在android:id
atahh是的,这是我的错,我没看到。。He He谢谢谢谢谢谢你这很有效。。非常感谢你呼呼是的非常感谢你真的很有帮助我还有很多东西要学。。还有更多的问题要问哈哈。。希望你能再次回复。
TextView android:id="@+id/label"
<TextView
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>