I want to make a Actionbar_style.xml for my app and I would like to use a logo, different than my app logo / icon.
How to change it programmatcially is clear: Change logo that appears in Android ActionBar programatically
But like this I would need to code this into each activity.
Is there a xml tag to define a custom Actionbarlogo in xml already?
my Customstyles.xml
<style name="CustomActionBar0" parent="android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">@drawable/action_bg0</item>
</style>
android styles.xml seems not to have it...
<style name="Widget.ActionBar">
<item name="android:background">@android:drawable/action_bar_background</item>
<item name="android:displayOptions">useLogo|showHome|showTitle</item>
<item name="android:divider">@android:drawable/action_bar_divider</item>
<item name="android:height">?android:attr/actionBarSize</item>
<item name="android:paddingLeft">0dip</item>
<item name="android:paddingTop">0dip</item>
<item name="android:paddingRight">0dip</item>
<item name="android:paddingBottom">0dip</item>
<item name="android:titleTextStyle">@android:style/TextAppearance.Widget.ActionBar.Title</item>
<item name="android:subtitleTextStyle">@android:style/TextAppearance.Widget.ActionBar.Subtitle</item>
<item name="android:progressBarStyle">@android:style/Widget.ProgressBar.Horizontal</item>
<item name="android:indeterminateProgressStyle">@android:style/Widget.ProgressBar.Small</item>
<item name="android:homeLayout">@android:layout/action_bar_home</item>
</style>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…