2014-05-24 65 views
0

我剛開始編寫java/android,並且我不知道爲什麼我得到了Error parsing XML: unbound prefix錯誤和attribute is missing the android namespace prefix.我正在使用Eclipse。該Error parsing XML: unbound prefix錯誤是從線路:解析XML時出錯:使用android:id或android時出現未綁定前綴

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> 

請幫助!

+0

你也許是想寫android而不是andriod? – alko989

回答

1

的Andriod - > Android的 這就是爲什麼它不能找到前綴

1

你有的Andriod一個錯字。變化:

andriod:id="@+id/tvDisplay" 

android:id="@+id/tvDisplay" 

做的所有線路,其中那種錯字的是一樣的。

相關問題