2

I am trying to change the background of the top bar which is created by eclipse automatically. I have read some tutorials and they suggested me to change "styles.xml" file. here is what I have done so far...

<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:textColor">#008</item>
    <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item>
</style>

<style name="WindowTitleBackground">     
    <item name="android:background">#0000FF</item>
</style>

but this doesnt work. would you please take a look at it and tell me what is wrong with this code? because it doesnt do any effects.

Arif YILMAZ
  • 5,754
  • 26
  • 104
  • 189

1 Answers1

3

Make sure you reference this theme in your manifest

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

Then make sure your style is created correctly, previously you referenced a theme parent that wasn't in your code sample.

<style name="AppTheme" parent="@android:style/Theme.DeviceDefault">
    <item name="android:textColor">#008</item>
    <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item>
</style>

<style name="WindowTitleBackground">     
    <item name="android:background">#0000FF</item>    
</style>
jimmithy
  • 6,360
  • 2
  • 31
  • 29