Android:解析XML时出错:未绑定的前缀

时间:2014-07-05 12:48:48

标签: android xml layout

我想在https://github.com/attenzione/android-ColorPickerPreference处实现颜色选择器库:

要设置,在对话框中,根据网站上的说明添加xml,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center" >

    <RelativeLayout
        android:id="@+id/message_dialog"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:background="@drawable/layout_round_corners_blue" >

        <net.margaritov.preference.colorpicker.ColorPickerPreference   // error line
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            holo:defaultValue="@color/pumpkin_orange"
            holo:key="color1"
            holo:summary="@string/color1_summary"
            holo:title="@string/color1_title" />
    </RelativeLayout>

</RelativeLayout>

问题:

xml在标记为上述错误行的位置报告错误error: Error parsing XML: unbound prefix

上面的xml有什么问题?

1 个答案:

答案 0 :(得分:0)

您必须将此<net.margaritov.preference.colorpicker.ColorPickerPreference更改为您添加此类的包,例如

<com.example.yourPackagewhereyouAddThisClass.ColorPickerPreference

喜欢

net.margaritov.preference.colorpicker

将上面的内容更改为您为其添加ColorPickerPreference类

的包名称