gpt4 book ai didi

android - 我的操作栏标题使用了错误的主题颜色

转载 作者:行者123 更新时间:2023-11-30 03:39:27 25 4
gpt4 key购买 nike

我正在尝试修改我的应用程序的主题。我已经能够成功地为我的应用程序设置背景颜色,并为我的操作栏设置背景颜色。

不幸的是,操作栏中项目的背景颜色采用应用程序的背景颜色,而不是操作栏的背景颜色。

这是我在 styles.xml 中的代码

<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
</style>


<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:background">#ff0000</item>
</style>


<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#fefefe</item>
</style>

这是正在发生的事情的屏幕截图。

screenshot of weird bg colors

希望我在这里遗漏了一些愚蠢的东西......

谢谢!

最佳答案

我很确定您的主题背景已应用于一切。相反,您只希望 Activity 的背景是那种颜色。因此,与其在主题中设置背景色,不如为 Activity 设置。如果您有许多将使用此背景颜色的 Activity ,请为您的 Activity 创建一个样式并将其应用于每个 Activity 。

关于android - 我的操作栏标题使用了错误的主题颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16039071/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com