android overflow menu in bottom bar

前端 未结 3 1650
野的像风
野的像风 2021-01-07 10:08

I\'m trying to get the overflow button from the action bar to show up in the bottom, next to the back/home/other-apps buttons. I was assuming this would be the case if I tur

相关标签:
3条回答
  • 2021-01-07 10:49

    In your AndroidManifest you have to set the targetSdkVersion to 13 or earlier like this:

    <uses-sdk android:targetSdkVersion="13" />
    

    That will force ICS to run your app in compatibility mode and give you the 3 dots in your bottom bar for your overflow menu.

    0 讨论(0)
  • 2021-01-07 10:49

    Adding the overflow menu button to the system navigation bar is done to support apps targeting older version of android (2.3 and older) that don't have a hardware Menu button.

    http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html

    The article above provides the logic when the system places the overflow button in the nav bar. It doesn't say how to force it to appear though for all devices. but it may help.

    0 讨论(0)
  • 2021-01-07 11:01

    Did you try this code for creating option menu?

      //Menu options within the app.
        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            // Inflate the menu; this adds items to the action bar if it is present.
            getMenuInflater().inflate(R.menu.main, menu);
            return true;
        }
    
    0 讨论(0)
提交回复
热议问题