ListView分隔线不可见 [英] ListView divider is not visible
本文介绍了ListView分隔线不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用一条白线将my列表视图.我尝试了不同的方法,但仍然无法理解.代码:
I want to have a white line which will divide m y listview. I was trying different ways but still I can't get it. Code:
<?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:
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>
这篇关于ListView分隔线不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文