简体   繁体   English

无法更改 Theme.Holo.Light 操作栏的背景颜色

[英]Can't change background color of Theme.Holo.Light action bar

I want to change colorPrimary of Theme.Holo.Light, but nothing changes.我想更改 Theme.Holo.Light 的 colorPrimary,但没有任何改变。

<resources>

    <color name="black">#FF000000</color>
    <color name="whitegrey">#FFF2F2F2</color>
    <color name="colorPrimary">#FF0F91CD</color>
    <color name="holo_light_primary">#FF0F91CD</color>

    <style name="AppTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:colorPrimary">@color/holo_light_primary</item>
    </style>

</resources>

And I am using custom theme's name in AndroidManisfesto as well.我也在 AndroidManisfesto 中使用自定义主题的名称。 What am I doing wrong?我究竟做错了什么?

In your manifest, you're using your custom theme, and you're ignoring AppTheme, which holds the required change.在您的清单中,您使用的是自定义主题,而您忽略了 AppTheme,它包含所需的更改。 Just move this line:只需移动这一行:

 <item name="android:colorPrimary">@color/holo_light_primary</item>

to your custom theme element.到您的自定义主题元素。

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

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