2017-07-07 61 views
-1

我無法理解,爲什麼分隔符不會在每個項目後出現?它只顯示最後一個項目後!我真的不知道該怎麼做。每個項目後的列表視圖分隔符

我通過使用Jsoup解析一些信息。

我有什麼:

enter image description here

我的列表視圖

<ListView 
    android:id="@+id/listView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_alignParentEnd="true" 
    android:layout_alignParentTop="true" 
    android:touchscreenBlocksFocus="true" /> 

回答

0

試試這個代碼:

<ListView 
    android:id="@+id/listView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_alignParentEnd="true" 
    android:layout_alignParentTop="true" 
    android:divider="#B9B9B9" 
    android:touchscreenBlocksFocus="true" /> 
0

如果您正在使用ListView控件,所有你需要做的就是添加的android :分隔標籤,如下所示:

<ListView 
    android:id="@+id/listView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_alignParentEnd="true" 
    android:layout_alignParentTop="true" 
    android:touchscreenBlocksFocus="true" 
    android:divider="#FFCC00" 
    android:dividerHeight="2dp"/> 

另外您也可以選擇使用android:dividerHeight標籤設置分隔線高度。

相關問題