I'm working with Android ViewPager in three views. I added a android.support.v4.view.PagerTabStrip to display the title of each view.
Current appearance
Desired appearance
How I can get this result?
Regards!
I customize my PagerTabStrip by customizing AppThemes in the styles.xml, the code below is how I do it in my apps.
<style name="_AppTheme" parent="android:Theme.Holo.Light">
<item name="android:actionBarStyle">@style/mActionBar</item>
<item name="android:actionMenuTextColor">#FFFFFF</item>
<item name="android:actionBarTabTextStyle">@style/ActionBarTextStyle</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="ActionBarTextStyle" parent="AppBaseTheme">
<item name="android:textColor">#FF8800</item>
<item name="android:drawablePadding">10dp</item>
<item name="android:paddingLeft">10dp</item>
<item name="android:paddingRight">10dp</item>
</style>
<style name="ActionBarTabStyle" parent="@style/Widget.AppCompat.Light.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_example</item>
<item name="android:drawablePadding">10dp</item>
</style>
<style name="mActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#FF8800</item>
<item name="android:icon">@android:color/transparent</item>
<item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
</style>
<style name="MyTheme.ActionBar.TitleTextStyle" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#FFFFFF</item>
<item name="android:drawablePadding">10dp</item>
<item name="android:paddingLeft">10dp</item>
<item name="android:paddingRight">10dp</item>
</style>
Hope it helps you. =)
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