ActionBarsherlock how to set dividers on menu items with icons only
Asked Answered
B

1

6

Hello android developers, I know this question have been asked many of times, and I have also tried many solutions but they are not working for me. Firstly I am using action bar sherlock library to show action bar,and I want to show dividers between menu items with icons only. For that I create custom style for showing divider but they are not showing.

<style name="Theme.SherlockCustom" parent="@style/Theme.Sherlock.Light">

<item name="android:actionBarDivider">@drawable/actionbar_seprator</item>

<item name="android:showDividers">middle</item>

</style>

And also tried to update sherlock library ActionMenuItemView.java for ActionBar where needsDividerBefore() will always give true. But this patch also not worked for me. Please help where I am going wrong. Thanks.

Brewington answered 10/4, 2013 at 6:32 Comment(2)
You are probably trying this on a device with Android > 4.0. The patch you mentioned is only applicable for Android < 3.0 because on later versions the native action bar implementation is used which you can't modify.Ankylosis
@matthias tons of thanks. Now I understood where I was going wrong. Can u please suggest how to get dividers in android > 4.0. Is there any solution for it.Brewington
D
0

You can't get dividers on versions > 4.0 for your scenario unless you use a custom view for your action bar; the native implementation controls the behavior internally and doesn't give any hook to modify that.

HTH, Ali.

Decane answered 28/6, 2013 at 2:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.