解析xml未绑定前缀的错误/

时间:2014-11-29 15:06:07

标签: xml parsing namespaces prefix

我是Android应用程序开发的新手,我收到了这些错误。请有人帮帮我

解析xml未绑定前缀

时出错

属性缺少android命名空间前缀

这是我的代码

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android="@+id/frontpagelayout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<Button
    android:id="@+id/ushop"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="93dp"
    android:layout_marginTop="38dp"
    android:text="@string/ushop" />

1 个答案:

答案 0 :(得分:0)

此属性:

android="@+id/frontpagelayout"

没有名称空间前缀(例如android:),并且您没有使用xmlns属性明确定义名称空间。

查看first result I got when googling中的示例,它应该是id属性:

android:id="@+id/frontpagelayout"