Android: always show menu bar/static menu bar

2020-08-02 06:38发布

问题:

I would like to use the menu bar instead of a tab bar (tabs are not made for being at the bottom of the view ...).

Is there any chance to give the menu bar a static behaviour?

Related post: android : set the menu out / visible with the solution: new Handler().postDelayed(new Runnable() { public void run() { openOptionsMenu(); } }, 2000);

It works fine, but hides away constantly.

Many thankx!

回答1:

It sounds like you're trying to abuse menu functionalities. What could be the solution: create a vertical LinearLayout with two additional layouts inside. Let the top one have layout_weight="1" and here place your content. In the bottom one place images or buttons or similar, which you could make look like tab options or whatever you want.