我刚开始写java/android,我无论如何也搞不懂为什么我会收到Error parsing XML: unbound prefix
错误和我正在使用的attribute is missing the android namespace prefix.
。Error parsing XML: unbound prefix
错误来自以下行:
andriod:id="@+id/tvDisplay"
attribute is missing the android namespace prefix
来自:
andriod:text="Add One"
andriod:layout_gravity="center"
andriod:textSize="20dp"
代码:
<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>
发布于 2014-05-25 05:13:44
andriod -> android这就是它找不到前缀的原因。
发布于 2014-05-25 05:13:51
您在andrIOd中有一个拼写错误。更改:
andriod:id="@+id/tvDisplay"
至
android:id="@+id/tvDisplay"
在出现这种打字错误的所有行中执行相同的操作。
https://stackoverflow.com/questions/23849693
复制相似问题