Reputation: 22699
I am doing a simple customization to my app where I want to add a custom background color to Action Bar. Here is my styles.xml in styles-v14
folder. (My app is targeting only SDK 14 and above).
If I simply uncomment this line and run my app , the whole screen becomes white except status bar while I expect the Action Bar background color to be of different color.
<!-- <item name="android:actionBarStyle">@style/WindowTitleBackground</item> -->
Any idea what is going wrong. Here is my App manifest:
<application
android:name=".App"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
styles.xml
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:listChoiceIndicatorSingle">@drawable/btn_radio_holo_light</item>
<!-- <item name="android:actionBarStyle">@style/WindowTitleBackground</item> -->
</style>
<style name="RadioButtonAppTheme" parent="android:Widget.CompoundButton.RadioButton">
<item name="android:button">@drawable/btn_radio_holo_light</item>
</style>
<style name="WindowTitleBackground">
<item name="android:background">@color/titlebackgroundcolor</item>
</style>
</resources>
Upvotes: 0
Views: 358
Reputation: 693
Try adding parent
attribute in your ActionBar
style
<style name="WindowTitleBackground"> parent="@android:style/Widget.Holo.ActionBar"
<item name="android:background">@color/titlebackgroundcolor</item>
</style>
Upvotes: 1