【问题标题】:error parsing xml unbound prefix/解析 xml 未绑定前缀/时出错
【发布时间】:2015-01-27 23:59:10
【问题描述】:

我是 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" />

【问题讨论】:

    标签: xml parsing namespaces prefix


    【解决方案1】:

    这个属性:

    android="@+id/frontpagelayout"
    

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

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

    android:id="@+id/frontpagelayout"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-25
      • 1970-01-01
      • 2015-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多