2011-11-06 126 views
0

我是Android应用程序开发的新手,我试图调试我的代码,并得到第7行的错误。错误类型是APPT,如果这很重要。据我所知,我没有看到我的代码有任何问题。如果有任何想法,将不胜感激。错误:解析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:orientation="vertical"> 

<TextView 
    abdroid:id="@+id/label" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="Type here:"/> 

<EditText 
    android:id="@+id/ok" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/label"/> 

<Button 
    android:id="@+id/ok" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/entry" 
    android:layout_alignParentRight="true" 
    android:layout_marginLeft="10dip" 
    android:text="OK"/> 

<Button 
    android:id="@+id/cancel" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_toLeftOf="@+id/ok" 
    android:layout_alignTop="@+id/ok" 
    android:text="Cancel"/> 

回答

1

此行

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"> 

貌似问题。尝试将>结尾处移至android:orientation="vertical"的末尾。

编辑:

你也有一个错字。 abdroid:id="@+id/label"应该是android:id="@+id/label"

并确保您以</RelativeLayout>结束文件以关闭相对布局元素。

+0

我仍然得到相同的错误。 – John

+0

我编辑过,以显示更多的错误 – Craigy

+0

嗯,我有结束标签一定错过了它的副本,但Android上的错字是问题。为什么没有说问题是在第8行? – John

相关问题