android - error: Error parsing XML: unbound prefix

来源:互联网 发布:win域名可以备案吗 编辑:程序博客网 时间:2024/06/05 03:39
        我碰到这个问题是因为,在标签中使用了自己重写的控件,在头部没有引入命名空间的缘故。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:yx="com.yixin.nfyh.cloud.ui"

xmlns:yxw="com.yixin.nfyh.cloud.widget"

…………


>
            <com.yixin.nfyh.cloud.widget.SignsItemView
                android:id="@+id/sign_gaoya"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="10dp"
                android:layout_weight="1"
                android:background="@drawable/h_dbp"
                android:contentDescription="@string/tz_until_xy"
                android:tag="@string/tz_gaoya" >
            </com.yixin.nfyh.cloud.widget.SignsItemView>


</LinearLayout>

没写红色部分,先写了绿色部分,就会出现“Error parsing XML: unbound prefix” 错误!写上就OK了。

0 0