How to force use of overflow menu on devices with menu button

前端 未结 11 633
谎友^
谎友^ 2020-11-22 14:04

I\'d like to have all of the menu items that don\'t fit into the ActionBar go into the overflow menu (the one that is reached from the Action Bar not the menu button) ev

11条回答
  •  耶瑟儿~
    2020-11-22 14:16

    EDIT: Modified to answer for the situation of physical menu button.

    This is actually prevented by design. According to the Compatibility Section of the Android Design Guide,

    "...the action overflow is available from the menu hardware key. The resulting actions popup... is displayed at the bottom of the screen."

    You'll note in the screenshots, phones with a physical menu button don't have an overflow menu in the ActionBar. This avoids ambiguity for the user, essentially having two buttons available to open the exact same menu.

    To address the issue of consistency across devices: Ultimately it's more important to the user experience that your app behave consistently with every other app on the same device, than that it behave consistently with itself across all devices.

提交回复
热议问题