如何强制溢出菜单上的机器人动作条COMPAT? [英] How to force overflow menu on android actionbar compat?

查看:149
本文介绍了如何强制溢出菜单上的机器人动作条COMPAT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的Andr​​oid操作栏COMPAT
可能吗?在当菜单键pssed $ P $只显示旧设备(pre 3.0)不适合操作栏上的项目,我想这些项目在动作条的溢出菜单中进行分组。

Android action bar compat
Is it possible? On older devices (pre 3.0) the items that don't fit the action bar are only shown when the menu key is pressed, I want these items to be grouped in the actionbar's overflow menu.

推荐答案

的操作溢出菜单仅当有可用的设备上没有硬性菜单按钮。我发现这个陈述下用户界面框架专题>操作栏,在这里检查出的第3弹

The action overflow menu is only available when there is no hard menu button available on the device. I found this stated in the Framework Topics under User Interface > Action Bar, check out the 3rd bullet here.

有一个操作栏库写的杰克沃顿的所谓ActionBarSherlock。这或许能够为您提供一个动作溢出的菜单风格,即使在较旧的设备(其中包括硬盘菜单按钮),但我还没有考虑过这问题。

There is an action bar library written by Jake Wharton called ActionBarSherlock. Perhaps this is able to supply you with an action overflow menu style even when on older devices (which include a hard menu button), however I have not looked into this.

编辑: ActionBarSherlock 4.0(目前一个候选发布版)内置了强制行动溢出功能。如果你想延长ActionBarCompat比如你自己,你可能需要在github上一看就得到一个想法杰克如何实现它。我建议只是在寻找到使用他的图书馆都在一起,因为它是非常出色。

ActionBarSherlock 4.0 (currently a release candidate) has functionality built in to force action overflow. If you want to extend the ActionBarCompat example yourself, you could take a look on github to get an idea how Jake implemented it. I would suggest just looking into using his library all together, as it is very well done.

如果您选择使用杰克的图书馆,考虑设立活动主题为@风格/ Theme.Sherlock.ForceOverflow强制对旧设备的溢出菜单。

If you choose to use Jake's library, look into setting up the Activity theme as @style/Theme.Sherlock.ForceOverflow to force the overflow menu on older devices.

EDIT2:使用 ForceOverflow 主题导致的问题(的例如#1 )上的硬件菜单按钮的设备。因此,杰克沃顿是要删除 ForceOverflow 在未来的版本中。

Using ForceOverflow theme causes issues (example #1) on devices with hardware menu button. Thus, Jake Wharton is going to remove ForceOverflow in the future versions.

这篇关于如何强制溢出菜单上的机器人动作条COMPAT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆