蜂巢主题* .NoActionBar或* .NoTitleBar - 哪里是菜单按钮?蜂巢、按钮、菜单、主题

2023-09-06 14:47:20 作者:忘了有多久

我的清单设置: targetSdkVersion = 11

My manifest setup: targetSdkVersion=11

我有一个主题设置到Android活动:款式/ Theme.Holo.NoActionBar或Android:款式/ Theme.NoTitleBar

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.

问题是,在这样的组合,有没有办法按菜单按钮,因为没有显示任何菜单按钮。 如果targetSdkVersion为< 11,再有就是传统的菜单按钮,在底部的酒吧,我希望在那里,如果我选择隐藏操作栏

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?

目前是几个全息*主题与.NoActionBar版本,这些都应该是仅适用于那些没有菜单的应用程序?

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?

推荐答案

如果你想有一个菜单,要么使用操作栏,或创建自己的菜单系统。那是在蜂窝怎么样,而不是一个设计缺陷,但是一个设计选择。

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.

你可以做的是隐藏操作栏代替;检查this回答如何实现这样的事情。一个很好的策略,例如会隐藏操作栏,如果世界上没有用户活动(触摸事件发生的根本)。你可以设置一个计时器2秒在触事件后,将其隐藏和取消计时器如果在此期间触摸。同样再次显示它是否有触动。

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.