I'm setting up an action bar with Sherlock with 3 items/icons. Running on a ICS emulator, I only can see 2 icons. And moreover: NO overflow menu (those 3 dots-icon)! I only get the 3rd icon if I press the menu button of the phone.
Do I have to force the overflow icon, and if so how can I do so?
Do I have to force the overflow icon, and if so how can I do so?
All you need to do is have your theme inherit from one of the .ForceOverflow
themes. Note this will only work for Android 2.0 and 3.0. In 4.0 the native ActionBar
component is used instead, and the overflow item is only displayed if the device does not have a menu key.
Do I have to force the overflow icon
No.
Your emulator is set up, by default, to emulate a device that has an off-screen MENU key, like the Nexus S. Such devices will not have an on-screen overflow menu button -- users will use the MENU key to access the overflow. Many of those devices, like the Nexus S, will be ones upgraded from Android 2.x, where the user will already be used to pressing the MENU key to get what used to be the options menu and now is the overflow menu.
You can switch your emulator to emulate a device without an off-screen MENU key. In your AVD Manager, for an AVD, add the "Hardware Back/Home keys" property (which, despite the name, also has the MENU key) and set it to be true or false as you wish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With