首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用android:id或android:text时,解析XML: unbound前缀时出错

使用android:id或android:text时,解析XML: unbound前缀时出错
EN

Stack Overflow用户
提问于 2014-05-25 05:10:00
回答 2查看 131关注 0票数 0

我刚开始写java/android,我无论如何也搞不懂为什么我会收到Error parsing XML: unbound prefix错误和我正在使用的attribute is missing the android namespace prefix.Error parsing XML: unbound prefix错误来自以下行:

代码语言:javascript
复制
andriod:id="@+id/tvDisplay"  

attribute is missing the android namespace prefix来自:

代码语言:javascript
复制
andriod:text="Add One"
andriod:layout_gravity="center"
andriod:textSize="20dp"

代码:

代码语言:javascript
复制
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.Marett.Driod.MainActivity$PlaceholderFragment" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/Total"
        android:textSize="45sp" 
        andriod:id="@+id/tvDisplay"
        />
<Button 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    andriod:text="Add One"
    andriod:layout_gravity="center"
    andriod:textSize="20dp"
    />

</RelativeLayout>
EN

回答 2

Stack Overflow用户

发布于 2014-05-25 05:13:44

andriod -> android这就是它找不到前缀的原因。

票数 1
EN

Stack Overflow用户

发布于 2014-05-25 05:13:51

您在andrIOd中有一个拼写错误。更改:

代码语言:javascript
复制
andriod:id="@+id/tvDisplay"

代码语言:javascript
复制
android:id="@+id/tvDisplay"

在出现这种打字错误的所有行中执行相同的操作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23849693

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档