I've inherited the Holo Light Theme and customized the background of the ActionBar with the following:
Content of styles.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="ActionBar" parent="@android:style/Widget.Holo.ActionBar"> <item name="android:background">@drawable/actionbar_background</item> </style> <style name="MyTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">@style/ActionBar</item> </style> </resources>
Content of actionbar_background.xml
<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@raw/actionbar_background" android:tileMode="repeat" />
Instead of being repeated, the image is stretched, any idea of why android:tileMode="repeat" is not applied?
Thanks in advance
Android ActionBar is a menu bar that runs across the top of the activity screen in android. Android ActionBar can contain menu items which become visible when the user clicks the “menu” button.
An on-screen toolbar displaying icons that are clicked or tapped to perform various functions. For example, the menu bar at the top of an Android app is called an action bar.
Drawable d=getResources().getDrawable(R.drawable.background_image_name); getActionBar().setBackgroundDrawable(d);
The above code sets the background image for the action bar.
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With