Android action bar tab bar divider

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 07:58:47
allsoft

Use the property of "actionBarDivider" on the custom style.

Something like below

<style name="AppTheme" parent="AppBaseTheme">
     <!-- You app specific customization -->
     <item name="android:actionBarStyle">@style/MyActionBar</item>
     <item name="android:actionMenuTextColor">@color/menu_state_list</item>
     <item name="android:actionBarTabStyle">@style/tabStyle</item>
     <item name="android:actionBarTabTextStyle">@style/tabTextColor</item>

     <!-- Set it like this -->
     <item name="android:actionBarDivider">@drawable/verticle_marker_thin</item>
</style>

create tab divider picture

in styles add an item shown below

<item name="android:actionBarTabBarStyle">@style/customTabBar</item> 

code for devider in action bar tab indicator

<style name="customTabBar" parent="@style/Widget.AppCompat.ActionBar.TabBar">
<item name="android:showDividers">middle</item>
<!-- give your divider here -->
<item name="android:divider">@drawable/tabindicator</item>
<item name="android:dividerPadding">0dp</item>

where @drawble/tabindicator is a picture in drawble

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!