2014-05-21 55 views
0

我想創建一個多列列表視圖,並在佈局文件夾中創建了一個名爲row的新xml文件。不過,我得到了一個錯誤說解析XML時出錯:格式不正確(無效令牌)多列ListView

錯誤解析XML:沒有很好地形成(標記無效)

我似乎無法找出問題所在,雖然我覺得我已經錯過了封閉標籤和或拼寫錯誤一些東西。非常感激!

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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 


<TextView 
    android:id="@+id/name" 
    android:gravity="left" 
    android:layout_width="50dip" 
    android:layout_height="wrap_content" /> 

<TextView 
    android:id="@+id/path" 
    android:gravity=」center」 
    android:layout_width="70dip" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" /> 
</LinearLayout> 
+1

您忘記了佈局的結束標記。 – Onik

+0

@Onik我補充說,就在這時,但是我仍然得到同樣的錯誤 – DorkMonstuh

+1

+您在這裏有不同的雙引號:'安卓重力=」中心」' – Onik

回答

0

改變這一點。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 


<TextView 
    android:id="@+id/name" 
    android:gravity="left" 
    android:layout_width="50dip" 
    android:layout_height="wrap_content" /> 

<TextView 
    android:id="@+id/path" 
    android:gravity="center" <!-- this --> 
    android:layout_width="70dip" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" /> 
</LinearLayout> 
+0

你能解釋一下問題是什麼? – hichris123

+0

android:gravity =「center」to android:gravity =「center」 – Chefes

相關問題