Padding menu items in action bar sherlock [duplica

2019-02-17 20:30发布

This question already has an answer here:

I'm having action bar which Title Name, Search and Action Overflow menu item, though i'm using ActionBarSherlock library for this. I want to remove padding for search and Action Overflow menu item in action bar.

1条回答
相关推荐>>
2楼-- · 2019-02-17 20:57

Check this link:

ActionBarSherlock - How to set the padding of each actionbar's icon?

The idea is to create a new theme which has a parent theme as Theme.Sherlock

and lower actionButtonStyle minWidth attribute

<style name="MyTheme" parent="Theme.Sherlock">
    <item name="actionButtonStyle">@style/MyActionButtonStyle</item>
</style>

<style name="MyActionButtonStyle" parent="Widget.Sherlock.ActionButton">
    <item name="android:minWidth">28dip</item>
</style>

and apply this theme to your Activity in the manifest.

查看更多
登录 后发表回答