意外的命名空间preFIX"的xmlns"对于标签片段 [英] Unexpected namespace prefix "xmlns" for tag fragment
本文介绍了意外的命名空间preFIX"的xmlns"对于标签片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
试图在XML文件中的一些变化和新的问题解雇了:
Trying to make some changes in XML file and new problem fired up:
她的code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<fragment
xmlns:map="http://schemas.android.com/apk/res/android"
map:id="@+id/map"
map:name="com.google.android.gms.maps.MapFragment"
map:layout_width="wrap_content"
map:layout_height="250dp" />
</LinearLayout>
在
xmlns:map="http://schemas.android.com/apk/res/android"
意外的命名空间preFIX的xmlns的标签片段
推荐答案
不知道如果我在这里帮助,但我只在我的RelativeLayout的情况下,一旦申报命名空间
Not sure if I'm helpful here but i only declare the Namespace once in my case in the RelativeLayout
<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" >
<fragment class="com.blablabla.MyFragment"
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
我不片段中再次声明命名空间如上图所示。据我所知道的唯一的命名空间已TE在父的ViewGroup申报一次。
I dont declare the namespace again in the fragment as shown above. As far as I know the Namespace only has te be declared once in the parent ViewGroup
这篇关于意外的命名空间preFIX&QUOT;的xmlns&QUOT;对于标签片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文