Yashwanth Kumar
Yashwanth Kumar

Reputation: 29121

Spacing between overflow icon and action items in ActionBarSherlock

I am using ActionBarSherlock(ABS) in my project, the overflow icon takes too much margin to the left from the action items. I have the latest library of ABS in my project. You can see the screenshot below of the mentioned problem.

sherlock action bar jelly bean

The mobile is running on JellyBean version. How can i reduce the space between the overflow icon and action items?

UPDATE

I have tried changing the action items attributes , by applying the custom theme

<style name="DelightActionButtonStyle" parent="Widget.Sherlock.ActionButton">
        <!--  <item name="android:background">?attr/actionBarItemBackground</item> -->
        <item name="android:background">@color/black</item>
        <item name="android:minHeight">?attr/actionBarSize</item>

        <item name="android:minWidth">0dp</item>
        <item name="android:gravity">center</item>
        <item name="android:paddingLeft">20dp</item>
        <item name="android:paddingRight">20dp</item>
        <item name="android:scaleType">center</item>
    </style>

only background attribute takes effect on the devices which doesn't have menu button. i played with the attributes changing the margins and padding, nothing seems to have an effect. Is there a way to control these attributes for action items?

Upvotes: 5

Views: 7204

Answers (2)

Matthias Robbers
Matthias Robbers

Reputation: 15728

If you really need to change it, here is how to reduce the width of the overflow button:

<style name="AppTheme" parent="Theme.Sherlock">
    <item name="android:actionOverflowButtonStyle">@style/MyOverflowButton</item>
</style>

<style name="MyOverflowButton" parent="Widget.Sherlock.ActionButton.Overflow">
    <item name="android:minWidth">32dip</item>
    <item name="android:padding">0dip</item>
</style>

Upvotes: 6

Paul Burke
Paul Burke

Reputation: 25584

Your action buttons are too small. They should not be smaller than 48dp. If this must be done (it shouldn't), you can override the actionButtonStyle android:minWidth attribute:

https://stackoverflow.com/a/10808259/377260

Be sure to also include android:actionButtonStyle.

Upvotes: 2

Related Questions