如何更改所有列表视图的默认颜色分 [英] How to change the default divider color for all ListViews

查看:164
本文介绍了如何更改所有列表视图的默认颜色分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想申请的默认样式从style.xml所有列表视图

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

请注意在一些地方,我使用嵌套的列表视图。

Please note at some places I am using nested listViews.

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>

这没有任何影响。在清单Theme.MyTheme作为我的默认主题。
请指点:)

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

推荐答案

作为另一个回答提到作为Bhavin和马克指出,在你的风格,你也应该添加

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

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

这篇关于如何更改所有列表视图的默认颜色分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆