Relative Layout not compiling!
I was trying to do an adapter on a ListView as an exercise but I get a strange error on the row layout:
error: Error parsing XML: unbound prefix
What is wrong with this very simple Layout??!?
<?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="wrap_content">
<TextView
android:id="@+id/station"
android:text="Stazione DI"
android:layout_alignParentTop="true"
android:padding="3dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
androdi:id="@+id/time"
android:text="Time:"
android:layout_alignParentLeft="true"
android:below="@i开发者_高级运维d/station"/>
<TextView
androdi:id="+id/late"
android:text="Time:"
android:layout_toRightOf="@id/time"
android:below="@id/station"/>
<TextView
androdi:id="+id/rail"
android:text="Rail:"
android:below="@id/station"
android:layout_toRightOf="@id/late"/>
</RelativeLayout>
Prefixes are those strings you type before the :
, like android:...
. And you typed it wrong once (androdi:...
)
(edit: actually 3 times)
Prefixes in Last TextView spell not correct, check that
In xml file last Textview is worong
<TextView
androdi:id="+id/rail"
android:text="Rail:"
android:below="@id/station"
android:layout_toRightOf="@id/late"/>
It will be
<TextView
android:id="+id/rail"
android:text="Rail:"
android:below="@id/station"
android:layout_toRightOf="@id/late"/>
you have written android spelling wrong in following cases !
androdi:id="@+id/time"
androdi:id="+id/late"
androdi:id="+id/rail"
精彩评论