尝试对 XML 文件进行一些更改,但出现了新问题:
她的代码:
<?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"
标签片段出现意外的命名空间前缀“xmlns”
不确定我在这里是否有帮助,但在我的情况下,我只在相对布局中声明一次命名空间
<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>
我没有在片段中再次声明名称空间,如上所示。据我所知,命名空间仅在父 ViewGroup 中声明一次
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)