【发布时间】:2023-04-02 06:45:01
【问题描述】:
我想为我的 android 应用程序设置自定义主题,但无法这样做。以下是我的 xml sn-p :
res/values/themes.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme"
parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar"
parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">#FF0000</item>
</style>
</resources>
在清单中,我已将 android:theme 属性更改为 :
android:theme="@style/CustomActionBarTheme"
但是,它仍然不适合我。我得到的主题是 Theme.AppCompat.Light.DarkActionBar。
【问题讨论】:
标签: android android-layout android-manifest android-theme android-styles