安卓:Optionsmenu“更多列表”的图标 [英] Android: Optionsmenu 'More-list' with icons

查看:349
本文介绍了安卓:Optionsmenu“更多列表”的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我爱怎么机器人全自动显示许多菜单项的选项菜单中,当有太多的屏幕,它会显示一个更多按钮。我想保持这种方式,但在弹出的菜单项是你当你preSS更多没有menuicons。有没有办法,我可以否决的办法吗?如果没有,我怎么能显示自己的弹出当用户点击更多?我仍然希望该机器人计算出有多少菜单项适合用户的屏幕上。

非常感谢! 埃里克

解决方案
  

有没有办法,我可以否决的办法吗?

没有,对不起。溢出菜单,如上下文菜单,没有图标。

  

如果没有,我怎么能显示自己的弹出当用户点击更多?

步骤1:将在五个菜单项

步骤2:将在第六菜单项,命名为更多,相应的图标

第三步:当用户点击更多项,做你想做的(例如,AlertDialog)

  

我还是希望该机器人计算出有多少菜单项适合用户的屏幕上。

在present,规则始终是6。既然你知道你要多少菜单项,就可以判断自己是否需要自己实现更多。

这是可能的Andr​​oid将开始支持更多的选项菜单中选择,因为屏幕尺寸变得更大。然而,在此之前,我们没有办法的predicting如何最好地满足您的预期目标,或者如果它甚至有可能。

I love how Android automaticly displays a number of menuitems in the options menu and when there are too many for your screen, it displays a 'More' button. I'd like to keep it that way, but the menuitems in the popup that you get when you press 'More' don't have the menuicons. Is there a way that I can overrule this? If not, how can I display my own popup when the user clicks 'More'? I still want that Android figures out how many menuitems fit on the users screen.

Thanks a lot! Erik

解决方案

Is there a way that I can overrule this?

No, sorry. The overflow menu, like context menus, do not have icons.

If not, how can I display my own popup when the user clicks 'More'?

Step #1: Put in five menu items

Step #2: Put in a sixth menu item, named "More", with an appropriate icon

Step #3: When the user taps the "More" item, do whatever you want (e.g., AlertDialog)

I still want that Android figures out how many menuitems fit on the users screen.

At present, the rule is always "6". Since you know how many menu items you want, you can determine for yourself whether you need your own implementation of "More".

It is possible that Android will start supporting more option menu choices as screen sizes get bigger. However, until that happens, we have no way of predicting how best to meet your desired goal, or if it is even possible.

这篇关于安卓:Optionsmenu“更多列表”的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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