新增]菜单"每个ListView项菜单、QUOT、ListView

2023-09-04 23:32:31 作者:炎阳灼心i

所以,我开发这个程序,其中中有一个列表视图,但我想补充的三个点图标,在角落里,当你preSS它,一个真棒菜单会弹出。像这样在谷歌Play应用: http://imgur.com/a/cGb2Q

So I'm developing this app, which has a listview in it, but I want to add the "three-dot" icon in the corner, and when you press it, an awesome menu will popup. Like this in the Google Play app: http://imgur.com/a/cGb2Q

我已经看到了,有它许多应用程序,所以它could'nt那么难?我用Google搜索了很多,但说实话,我真的不知道我应该谷歌。这必须可能是最短的&放大器;在最愚蠢的#1的问题,但我真的不知道我的其他的选择了。

I've seen many apps that have it, so it could'nt be that hard? I have googled a lot, but to be honest, I don't know really what I should google on. This must probably be the shortest & dumbest question on Stackoverflow, but I didn't really know what my other options was.

我有一个想法,它可能只是以某种方式被隐藏的微调,当你preSS的三个点的图标,它只会弹出一个真棒的方式,或者是这样实现在Android SDK?

I have a thought that it may just be an spinner that somehow is hidden and when you press the three-dot icon it'll just pop up in an awesome way, or is this implemented in the Android SDK?

我真的AP preciate如果有人想帮助我,回答我的queation。提前致谢! (对不起,我英文不好!) / GuiceU

I would really appreciate if someone want to help me and answer my queation. Thanks in advance! (Sorry for bad english!) /GuiceU

推荐答案

我不知道他们是如何做到这一点,或者如果这是最好的方式,但您可以创建图标(3点),并使用的PopupMenu 这一点。该混合物的加入 API 11 所以它不会工作在较旧的版本,但如果你的目标 API> = 11 那么我认为这将是一个不错的选择你。我在一个自定义的动作条使用它。

I don't know how they do it or if this is the best way but you could create the overflow icon (3 dots) and use a PopupMenu for this. This was added in API 11 so it wouldn't work on older versions but if you are targeting API >= 11 then I think this would be a good option for you. I use it in a custom "actionbar".

如果这还不够真棒你,那么你也可以使用 PopupWindow ,因为 API 1

If this isn't awesome enough for you then you can also use PopupWindow which has been around since API 1

PopupMenu的

PopupWindow