How to change the default divider color for all ListViews

两盒软妹~` 提交于 2019-12-23 08:38:48

问题


I am trying to apply default styling for all the listViews from style.xml

Please note at some places I am using nested listViews.

In style.xml

    <style name="Theme.MyTheme" parent="Theme.Sherlock.Light.ForceOverflow">
           <item name="android:windowContentOverlay">@null</item>
           <item name="android:listViewStyle">@style/awesomeListViewStyle</item>
    </style>



<style name="awesomeListViewStyle" parent="@android:style/Widget.ListView">
        <item name="android:fadingEdge">none</item>
    <item name="android:background">@color/orange</item>
<item name="android:divider">#EEEEEE</item>
    </style>

This has no effect. In the Manifest Theme.MyTheme as my default theme. Please advice :)


回答1:


As mentioned in another answer as Bhavin and Mark pointed out, in your style you should also add

<item name="android:dividerHeight">1px</item>


来源:https://stackoverflow.com/questions/10028246/how-to-change-the-default-divider-color-for-all-listviews

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!