在安卓开发中,在布局文件中如果出现Unexpected namespace prefix "xmlns" found for tag RelativeLayout 错误,一般情况下都是命名空间定义发生冲突所致,解决办法就是在多个布局格式后,只保留一个xmlns:android="http://schemas.android.com/apk/res/android", 其余的全删掉。如下所示,只保留<TabHost>后面一个命名空间的定义。
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
。。。。。。。。
.。。。。。。。。
<AbsoluteLayout
android:id="@+id/AbsoluteLayout03"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</LinearLayout>
</AbsoluteLayout>
</TabHost>