4

I'm using ActionBarSherlock to provide a unified UI for my Android 2.x and Android 4.x users. I have a menu with 6 items.

On a 2.x, 480px wide device with an hdpi screen, only 5 of the icons show. The device has a hardware Menu button, but when I tap it, nothing shows up. I expected it to popup and show the Action that wasn't able to fit.

enter image description here

I expect either the three-vertical-dots button to appear in the ActionBar to show a dropdown with the overflowed actions or I expect the physical Menu button to show the old style menu with the overflowed actions.

What am I missing or what am I doing wrong?

Here is my defined menu.xml:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/add"
        android:icon="@drawable/ic_menu_btn_add"
        android:showAsAction="always"
        android:title="Add"/>
    <item
        android:id="@+id/calculateNPV"
        android:icon="@drawable/menu_icon_npv"
        android:showAsAction="always"
        android:title="NPV"/>
    <item
        android:id="@+id/calculateIRR"
        android:icon="@drawable/menu_icon_irr"
        android:showAsAction="always"
        android:title="IRR/YR"/>
    <item
        android:id="@+id/send"
        android:icon="@android:drawable/ic_menu_share"
        android:showAsAction="always"
        android:title="@string/share_pdf"/>
    <item
        android:id="@+id/graph"
        android:icon="@drawable/ic_menu_gallery"
        android:showAsAction="always"
        android:title="@string/view_cashflow_diagram"/>
    <item
        android:id="@+id/deleteReorder"
        android:icon="@drawable/ic_menu_clear_playlist"
        android:showAsAction="always"
        android:title="@string/delete_reorder_cashflows"/>

</menu>
Kenny Wyland
  • 20,844
  • 26
  • 117
  • 229
  • check this---->http://stackoverflow.com/a/15832302/1168654 – Dhaval Parmar Apr 10 '13 at 04:58
  • The problem with "ifRoom" is that it is an utter lie. If I set the showAsAction="ifRoom" then it ALWAYS shows it in the overflow even if there is PLENTY of room. Yes, at the very least, it does make the options available via the menu button, but also makes them disappear from the ActionBar even when there is plenty of room... so I would like any other possible option. – Kenny Wyland Apr 10 '13 at 05:20
  • Evidence of the lies of "ifRoom", here is a screenshot of the same emulator with "always" and with "ifRoom" on the last two items. When it is "always", there is plenty of room and they are shown. When it is "ifRoom", even though there is PLENTY of room... they still aren't shown. http://inadaydevelopment.com/stackoverflow/Android%20Action%20ifRoom%20is%20a%20lie.png – Kenny Wyland Apr 10 '13 at 05:33

0 Answers0