Honeycomb themes *.NoActionBar or *.NoTitleBar - where is Menu button?

匆匆过客 提交于 2019-12-30 08:16:07

问题


My manifest setup: targetSdkVersion=11

I have Activity with theme set to android:style/Theme.Holo.NoActionBar or android:style/Theme.NoTitleBar

Desired result: app that doesn't show top bar (action bar or title bar), and has menu. I want almost full screen (video player or image viewer) possibly with dimmed status bar.

Problem is that in such combination, there's no way to push menu button, because there's no Menu button shown. If targetSdkVersion is <11, then there's legacy Menu button at bottom bar, which I would expect to be there if I choose to hide Action bar.

There's no hardware menu button on tablets, there's no virtual menu button with above condition.

Is it some design fault on Honeycomb, that forces all apps to have Action bar in order to have menus?

There're several Holo.* themes with .NoActionBar version, are these supposed to be only for apps that have no menu?

I'm confused why menu button is not moved to bottom bar if I choose not to have action bar.

Question: can I have no action bar and still offer menu while targeting my app to Honeycomb?


回答1:


If you want a menu, either use the action bar or create your own menu system. Thats how it is in Honeycomb, and not a design flaw but a design choice.

What you could do is hide the action bar instead; Check this answer on how to achieve such things. A nice strategy for example would be to hide the action bar if theres no user activity (touch events happening basically). You could set a timer to hide it after 2 seconds upon touchUp events and cancel the timer if there is a touch in the meantime. Similarly show it again if there are touches.



来源:https://stackoverflow.com/questions/7688854/honeycomb-themes-noactionbar-or-notitlebar-where-is-menu-button

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