2012-02-11 106 views
1

我試圖按如下方式創建XML文件。但我'提示以下錯誤:生成XML文件時出現Android錯誤

Unparsed aapt error(s) check the Console for output 

在cosole,我'提示以下錯誤:

[2012-02-11 20:39:08 - TEST] res\layout\final.xml:0: error: invalid symbol: 'final' 

我的XML文件如下

<?xml version="1.0" encoding="utf-8"?> 

<TableLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_height="fill_parent" 
android:layout_width="fill_parent" 
android:background="#000044"> 

<TableRow> 

<TextView 
android:text="Col 1" 
android:width ="80px" 
android:layout_height="wrap_content" 
android:layout_width="wrap_content" 
/> 

<TextView 
android:text="Col 2" 
android:width ="80px" 
/> 

<TextView 
android:text="Col 3" 
android:width ="80px" 
/> 

<TextView 
android:text="Col 4" 
android:width ="80px" 
/> 

<TextView 
android:text="Col 5" 
android:width ="120px" 
/> 

</TableRow> 

<TableRow> 
<TextView /> 

</TableRow> 


</TableLayout> 

請幫助

謝謝

KR

回答

3

final是java的保留關鍵字。因此,而不是最終,將其更改爲類似layout_final

更多的信息,請閱讀this

+0

尼斯漁獲物。我一直盯着那個代碼5分鐘,並沒有想到這一點。 +1 – Squonk 2012-02-11 20:33:46

+0

咯咯笑起來:p – waqaslam 2012-02-11 20:35:26

+0

謝謝Waqas。這已經解決了錯誤 – BookFans 2012-02-12 12:18:20