ListView分隔符不可见

时间:2014-03-10 20:47:52

标签: android android-listview

我想要一条白线来划分m 列表视图。我尝试了不同的方法,但我仍然无法得到它。代码:

 <?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:background="@color/dark_background"
     android:orientation="vertical" >

     <ListView
         android:id="@+id/lvFragFeedList"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:background="@drawable/alerts_list_item_selector"
         android:choiceMode="singleChoice" 
         android:divider="@color/archive_list_view_divider"
         android:dividerHeight="4dip">
     </ListView>

 </LinearLayout>

1 个答案:

答案 0 :(得分:3)

 <ListView
     android:id="@+id/lvFragFeedList"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@drawable/alerts_list_item_selector"
     android:choiceMode="singleChoice" 
     android:divider="@drawable/list_divider"
     android:dividerHeight="4dip">
 </ListView>

list_divider:

<shape
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:shape="line">
<stroke
  android:width="1px"
  android:color="#FFFFFF"
  android:dashWidth="1px"
  android:dashGap="1px" />
</shape>