how to keep an options menu always on the screen

房东的猫 提交于 2019-12-23 11:53:02

问题


I need the options menu to be displayed on screen always.. I've written the code to open options menu on the startup of an activity..

@Override
    public void onAttachedToWindow() {
        openOptionsMenu(); 
    };

But on clicking on another item on the screen, the menu goes down.. I want the menu to be on screen always.. Is there any way to do that?


回答1:


Please try the following code:

@Override
public void onOptionsMenuClosed(Menu menu) {
openOptionsMenu();
}


来源:https://stackoverflow.com/questions/12489590/how-to-keep-an-options-menu-always-on-the-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!