Action bar overflow not displayed

前端 未结 2 1446
醉话见心
醉话见心 2021-02-06 12:30

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

相关标签:
2条回答
  • 2021-02-06 12:57

    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.

    0 讨论(0)
  • 2021-02-06 13:08

    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.

    0 讨论(0)
提交回复
热议问题