Reputation: 105
I want to set a custom theme to my android application, but unable to do so. Following is my xml snippet :
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>
In manifest I've changed the android:theme property to :
android:theme="@style/CustomActionBarTheme"
But still, its not working for me. The theme am getting is Theme.AppCompat.Light.DarkActionBar.
Upvotes: 0
Views: 562
Reputation: 105
I found the solution by modifying style.xml :
<!-- Base application theme. -->
<style name="CustomAppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#FF0000</item>
</style>
Upvotes: 2
Reputation: 1444
Add your CustomActionBarTheme
theme in res/values/style.xml
and it will work.
Upvotes: 0
Reputation: 1510
You need to create res/values/style.xml or make these changes in res/values/style.xml
themes.xml not work in android project.
And set your custom theme in your manifest in
<application ...
android:theme="@style/Your_Custom_Theme_Name"
>
...
</application>
Upvotes: 0