Search This Blog

22 April 2010

Setting an image background for the window title

Continuing from our Theme example, I decided to change the window title to have a background image...

This is just a little simple image I made in GIMP using the granite fill tool... save this file to your src/main/android/res/drawable directory.

 Add a new style to styles.xml:
    <style name="HelloWindowTitleBG">
        <item name="android:background">@drawable/granite</item>

Add this line to the Hello Theme (styles.xml):
        <item name="android:windowTitleBackgroundStyle">@style/HelloWindowTitleBG</item>
Redeploy (mvn clean install) and your app now has a stylish window title.

No comments:

Post a Comment