Firstly, there is the image of my current tab bar
What I want is either aligning the images to very left, while keeping the text centered or moving the images on top of the text centered.
Here is how I add the texts:
var tab = this.ActionBar.NewTab ();
tab.SetText (tabText);
tab.SetIcon (iconResourceId);
Here is my relevant style.xml entries:
<style name="Theme.Discover" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:actionBarTabStyle">@style/MyActionBarTabStyle</item>
<item name="android:actionBarTabTextStyle">@style/MyActionBarTabText</item>
<item name="android:actionMenuTextColor">#ffffff</item>
<item name="android:windowBackground">@drawable/bg</item>
</style>
<style name="MyActionBarTabStyle" parent="@android:style/Widget.Holo.Light.ActionBar.TabView">
<item name="android:background">@drawable/action_tab_selector</item>
</style>
<!-- ActionBar tabs text styles -->
<style name="MyActionBarTabText"
parent="@android:style/Widget.Holo.ActionBar.TabText">
<item name="android:textColor">#ffffff</item>
</style>
I can understand java code too so if you are not familiar with Xamarin, I still appreciate the java examples&answers.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…