Android: Create a Quick Action Menu

佐手、 提交于 2019-11-28 05:44:49

问题


I need to create some type of quick action menu that appears to the right side of the clicked item (button) whenever the user clicks the button.

Here's an example of what I'm trying to achieve:

When the user clicks button1 I want the "sub quick action menu" to appear like it's shown in the image above. Is there anyway to do this 'natively' in android?

I have found this plugin but it only allows you to show the menu from the top or bottom of the button. https://github.com/lorensiuswlt/NewQuickAction3D


回答1:


As tyczj said, you could achieve that with a PopupMenu. The idea is that the popup menu will inflate a custom view with all the elements, having as background a 9 patch image.
Here's a blog post that shows how to do that. Hope it will help you.




回答2:


You can do the same using Quick Action Menu, for more details you can follow the

"http://www.codeproject.com/Articles/521455/Quick-action-pattern-in-Android-and-simple-impleme" Link.

In example Items are presented in horizontal manner, whereas you can manage them, like listview as per your requirement.




回答3:


there is a PopupMenu but there is no arrow or anything pointing to where it came from. Its basically the same thing that comes up when clicking the Overflow actionbar item




回答4:


Maybe this link can help you ;) But instead of sliding use press button.

Making a slide menu



来源:https://stackoverflow.com/questions/17370532/android-create-a-quick-action-menu

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