4

My problem is particular action item icon and "overflow menu" icon overlap each other in the split action bar as shown below.

screenshot

A menu resource file I use:

<menu xmlns:android="http://schemas.android.com/apk/res/android" >
    <item
        android:icon="@android:drawable/ic_menu_search"
        android:showAsAction="ifRoom"
        android:title="a"/>
    <item
        android:icon="@android:drawable/ic_menu_search"
        android:showAsAction="ifRoom"
        android:title="b"/>
    <item
        android:icon="@android:drawable/ic_menu_search"
        android:showAsAction="ifRoom"
        android:title="c"/>
    <item
        android:icon="@android:drawable/ic_menu_search"
        android:showAsAction="ifRoom"
        android:title="d"/>
    <item
        android:icon="@android:drawable/ic_menu_search"
        android:showAsAction="ifRoom"
        android:title="e"/>
    <item
        android:icon="@android:drawable/ic_menu_search"
        android:showAsAction="always"
        android:title="f"/>
    <item
        android:id="@+id/menu_settings"
        android:orderInCategory="100"
        android:showAsAction="never"
        android:title="@string/menu_settings"/>
</menu>

Remember that android:showAsAction attribute of sixth menu item is "always". When I use normal action bar, everything is ok.

So, is this behavior a bug of Android framework? Is there a workaround?

nagoya0
  • 2,768
  • 2
  • 23
  • 28

1 Answers1

4

So, is this behavior a bug of Android framework?

Presumably. You might wish to search the Android issue tracker to see if there are reports there. If not, create a reproducible test case that demonstrates the problem on an emulator or Nexus device, and post a new issue there. If you think of it, add a link to the issue as a comment on this answer.

Is there a workaround?

Replacing always with ifRoom for the sixth and subsequent action bar items, at least for -normal-port configurations, should work.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 1
    This is definitely a bug with Android. I've found the only completely safe way to use the "show always" flag is for the first items in the list (and Android guidelines state you should only use "show always" flag for at most 2 items). – vaughandroid Mar 04 '13 at 11:44