这似乎是一个非常简单的问题,但我不确定它是否可行。当对话框显示在顶部时,是否可以允许 MENU 按钮仍然调出选项的菜单?我想这样做是因为我想在打开对话框时为用户提供更多选项。
最佳答案
我认为这是不可能的。
虽然文档说你应该能够做到这一点。
A dialog is always created and displayed as a part of an Activity. You should normally create dialogs from within your Activity's onCreateDialog(int) callback method. When you use this callback, the Android system automatically manages the state of each dialog and hooks them to the Activity, effectively making it the "owner" of each dialog. As such, each dialog inherits certain properties from the Activity. For example, when a dialog is open, the Menu key reveals the options menu defined for the Activity and the volume keys modify the audio stream used by the Activity.
关于android - 打开带有对话框的选项菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6802607/