当前位置 : 主页 > 手机开发 > android >

android – 此XML中的错误:解析XML时出错:未绑定的前缀

来源:互联网 收集:自由互联 发布时间:2021-06-11
我解析 XML时出错:此xml文件中的未绑定前缀: ?xml version="1.0" encoding="UTF-8"?LinearLayout TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/sipLabel" android:layout_width="fill_parent"
我解析 XML时出错:此xml文件中的未绑定前缀:

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout>
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/sipLabel"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"/>
    <ImageView android:src="@drawable/connected" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_weight="0.35" android:gravity="center"/>
</LinearLayout>

该错误位于< ImageView>中.
可能是什么问题呢?

非常感谢你.

您必须在布局xml的根元素中放置名称空间声明xmlns:android =“http://schemas.android.com/apk/res/android”:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" [...]
网友评论