gpt4 book ai didi

android - 标记 fragment 的意外命名空间前缀 "xmlns"

转载 作者:搜寻专家 更新时间:2023-11-01 08:04:23 26 4
gpt4 key购买 nike

尝试在 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"

标签 fragment 的意外命名空间前缀“xmlns”

最佳答案

不确定我在这里是否有帮助,但我只在 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>

如上所示,我没有在 fragment 中再次声明命名空间。据我所知,命名空间只在父 ViewGroup 中声明过一次

关于android - 标记 fragment 的意外命名空间前缀 "xmlns",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16511605/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com