简体   繁体   English

Android对话框分隔线颜色

[英]Android Dialog Divider Color

I'm trying to make the dialog divider color lime. 我正在尝试使对话框分隔线变成灰白色。 My theme is already defined in android manifest and all. 我的主题已经在android manifest和all中定义了。 I defined the color lime in color.xml as well. 我也在color.xml中定义了石灰。

However, the divider is still not changing color from the default blue of the holo light theme. 但是,分隔线仍未从全息主题的默认蓝色更改颜色。

Here is my themes.xml 这是我的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 这是我的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 . 这是一种样式,因此应该在您的styles.xml ,而不是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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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