2012-08-31 86 views
0

對不起,我編碼一個簡單的android計算器,然後它顯示XML錯誤,我已經改變了一些代碼,但它不工作。爲什麼會這樣?在我的簡單的Android計算器中有一個錯誤

這是主要的代碼

<LinearLayout xmlsn:android ="http://schemas.android.com/apk/res/android" 
xmlns:tools ="http://schemas.android.com/tools" 
android:orientation="vertical" 
android:layou_width="fill_parent" 
android:layou_height="fill_parent" 
android:paddingTop="5dip"> 
<TextView 
android:id="@+id/tv" 
android:layout_width="fill_parent" 
android:layout_height="40dip" 
android:layout_marginLeft="5dip" 
andorid:layout_marginRight="5dip" 
android:background="#FFFFFF" 
android:gravity="center_verticallright" 
android:textColor="#ff0000" 
android:textSize="30dip"> 
</TextView> 
<LinearLayout 
android:orientation="horizontal" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:paddingTop="5dip"> 

然後我得到一個錯誤的警告:

the erro warning

它說

在該行發現

多個註釋:

  • 錯誤:錯誤解析XML:通過任一屬性規格, 「>」 或 「/>」 沒有很好地形成(標記無效)

  • 單元類型 「的LinearLayout」 必須遵循的。

感謝

+0

paste th e xml here – jeet

+1

你應該粘貼'xml',圖片不清晰 – Sieryuu

+0

@ jeet對不起,我的電腦中的圖片非常大 – Winnie

回答

0

嘛。你確定,你已經關閉了你的LinearLayout標籤嗎? 編輯器找不到標籤</LinearLayout>

它應該可能位於佈局文件的最底部。

0

我覺得你的TextView可是沒有關閉>。就在</textview>上面添加>

您的圖片,以小到真正看到它,那麼也許你應該只需上傳您的代碼

+0

我有,很抱歉,我已將主代碼放在 – Winnie

0

儘量把

</LinearLayout> 
</LinearLayout> 

在的xml

末和speeling是不正確,應該是android:layout_heightandroid:layou_height 同樣與寬度

這樣的結果將是

<LinearLayout xmlns:tools="http://schemas.android.com/tools" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" 
    android:orientation="vertical" 
    android:paddingTop="5dip" 
    xmlsn:android="http://schemas.android.com/apk/res/android" > 

    <TextView 
     android:id="@+id/tv" 
     android:layout_width="fill_parent" 
     android:layout_height="40dip" 
     andorid:layout_marginRight="5dip" 
     android:layout_marginLeft="5dip" 
     android:background="#FFFFFF" 
     android:gravity="center_verticallright" 
     android:textColor="#ff0000" 
     android:textSize="30dip" > 
    </TextView> 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" 
     android:paddingTop="5dip" > 
    </LinearLayout> 

</LinearLayout>