当前位置: 代码迷 >> Android >> ListView分隔线不可见
  详细解决方案

ListView分隔线不可见

热度:47   发布时间:2023-08-04 12:40:25.0

我想用一条白线将我的列表视图分开。 我尝试了不同的方式,但仍然无法实现。 码:

 <?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>
 <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>
  相关解决方案