简体   繁体   中英

Android Dialog Divider Color

I'm trying to make the dialog divider color lime. My theme is already defined in android manifest and all. I defined the color lime in color.xml as well.

However, the divider is still not changing color from the default blue of the holo light theme.

Here is my themes.xml

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="MyCustomTheme" parent="android:Theme.Holo.Light.NoActionBar">
        <item name="android:textColor">#3DE400</item>
        <item name="android:divider">@color/lime</item>

    </style>    
</resources>

Here is my color.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="lime">#3DE400</color>    
</resources>

Please Help Me..

This is a style, so it should be in your styles.xml , not themes.xml . Also, make sure it's linked to somewhere in there so the app knows to use it. Otherwise you're just defining the style, but it's not being used. An option is instead of defining your own style, simply customize the existing one. Eg:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.Holo.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="android:textColor">#3DE400</item>
    <item name="android:divider">@color/lime</item>
</style>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM