如何在活动开始时显示选项菜单
我想要在活动上显示选项菜单。但是,我希望在显示活动时始终显示选项菜单。我不希望我的用户单击(选择)菜单按钮来显示它。我希望它一直都在那里。我该怎么做?
谢谢
I've activity that i want an option menu to be displayed on. But, i want the option menu to be displayed all the time the activity is displayed. I don't want my users to click (select) the menu button to display it. I want it to be there all the time. How can i do it?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Activity.openOptionsMenu()
。从设计的角度来看,我必须同意 Mayra 的观点。一开始就采取了错误的方法。
Activity.openOptionsMenu()
.From a design standpoint, I have to agree with Mayra. Wrong approach to begin with.
如果您希望选项始终显示在屏幕底部,请不要使用选项菜单。只需将按钮放在屏幕底部即可。
但是,请记住,这违背了“Android 方式”的做事方式,因此请确保您了解 Android 用户将如何期望您的应用程序的外观和工作方式,并且您有充分的理由做一些不同的事情。
If you want options to appear at the bottom of the screen always, don't use the options menu. Just place buttons at the bottom of your screen.
However, keep in mind that this goes against the "Android way" of doing things, so make sure you understand how Android users are going to expect your application to look and work, and you have a good reason for doing something different.