Sunday, 15 March 2015

android - Change ActionBarTab line between items -



android - Change ActionBarTab line between items -

i working on android project, can't alter line between tab items. it's lite white / gray, want create black. i've tried alter style actionbar.solid.a background black, didn't solve problem. before inquire question i've check several similar problems, didn't find solution...

theme style <?xml version="1.0" encoding="utf-8"?> <resources> <style name="theme.a" parent="@android:style/theme.holo.light.darkactionbar"> <item name="android:actionbaritembackground">@drawable/selectable_background_a</item> <item name="android:popupmenustyle">@style/popupmenu.a</item> <item name="android:dropdownlistviewstyle">@style/dropdownlistview.a</item> <item name="android:actionbartabstyle">@style/actionbartabstyle.a</item> <item name="android:actiondropdownstyle">@style/dropdownnav.a</item> <item name="android:actionbarstyle">@style/actionbar.solid.a</item> <item name="android:actionmodebackground">@drawable/cab_background_top_a</item> <item name="android:actionmodesplitbackground">@drawable/cab_background_bottom_a</item> <item name="android:actionmodeclosebuttonstyle">@style/actionbutton.closemode.a</item> <!--<item name="android:actionoverflowbuttonstyle">@style/widget.actionbutton.overflow</item>--> <!-- light.darkactionbar specific --> <item name="android:actionbarwidgettheme">@style/theme.a.widget</item> </style> <style name="actionbar.solid.a" parent="@android:style/widget.holo.light.actionbar.solid.inverse"> <item name="android:titletextstyle">@style/theme.a.titletextstyle</item> <item name="android:background">@drawable/ab_solid_a</item> <item name="android:backgroundstacked">@drawable/ab_stacked_solid_a</item> <item name="android:backgroundsplit">@drawable/ab_bottom_solid_a</item> <item name="android:progressbarstyle">@style/progressbar.a</item> </style> <style name="actionbar.transparent.a" parent="@android:style/widget.holo.actionbar"> <item name="android:background">@drawable/ab_transparent_a</item> <item name="android:progressbarstyle">@style/progressbar.a</item> </style> <style name="popupmenu.a" parent="@android:style/widget.holo.listpopupwindow"> <item name="android:popupbackground">@drawable/menu_dropdown_panel_a</item> </style> <style name="dropdownlistview.a" parent="@android:style/widget.holo.listview.dropdown"> <item name="android:listselector">@drawable/selectable_background_a</item> <item name="android:textcolor">@color/main_white_color</item> </style> <style name="actionbartabstyle.a" parent="@android:style/widget.holo.actionbar.tabview"> <item name="android:background">@drawable/tab_indicator_ab_a</item> </style> <style name="dropdownnav.a" parent="@android:style/widget.holo.spinner"> <item name="android:background">@drawable/spinner_background_ab_a</item> <item name="android:popupbackground">@drawable/menu_dropdown_panel_a</item> <item name="android:dropdownselector">@drawable/selectable_background_a</item> </style> <style name="dropdownspinner.a" parent="@android:style/widget.holo.light.spinner"> <item name="android:popupbackground">@drawable/menu_dropdown_panel_spinner</item> </style> <style name="progressbar.a" parent="@android:style/widget.holo.progressbar.horizontal"> <item name="android:progressdrawable">@drawable/progress_horizontal_a</item> </style> <style name="actionbutton.closemode.a" parent="@android:style/widget.holo.actionbutton.closemode"> <item name="android:background">@drawable/btn_cab_done_a</item> </style> <!-- style referenced in light.darkactionbar based theme --> <style name="theme.a.widget" parent="@android:style/theme.holo"> <item name="android:popupmenustyle">@style/popupmenu.a</item> <item name="android:dropdownlistviewstyle">@style/dropdownlistview.a</item> <item name="android:textcolor">@color/main_white_color</item> </style> <!-- actionbar titletextstyle styles --> <style name="theme.a.titletextstyle" parent="@android:style/textappearance.holo.widget.actionbar.title"> <item name="android:textcolor">@color/main_white_color</item> </style> <!-- actionbar settingicon style --> <style name="widget.actionbutton.overflow" parent="@android:style/widget.holo.actionbutton.overflow"> <item name="android:src">@drawable/ic_dots</item> </style> </resources>

what want alter actionbartab divider color. can this:

inside actionbartabstyle.a definition, add:

<item name="android:actionbardivider">@drawable/tab_divider</item>

the tab_divider drawable xml file well:

<?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromdegrees="90" android:todegrees="90" > <shape android:shape="line" > <stroke android:dashwidth="3dp" android:width="4dp" android:color="@android:color/black" /> </shape> </rotate>

edit: alternative solution changing theme.a theme directly, adding:

<item name="actionbardivider">@android:color/black</item>

note android: prefix not beingness used.

android xml

No comments:

Post a Comment