Android 弹出菜单
我正在制作一个 Android 应用程序。我有一个显示的项目列表。我希望创建一个弹出菜单,就像您点击联系人列表中联系人的头像时弹出的菜单一样。我尝试查看 Android 参考但找不到它。
有人创建过这些弹出菜单之一吗?指向参考或代码示例的链接就可以了。
菜单截图:
I am making an Android app. I have a list of items displaying. I am looking to create a popup menu just like the one that pops up when you tap the avatar of a contact in the contact list. I have tried looking through the Android reference but can not find it.
Has anyone created one of these popup menus? A link to the reference or a code sample is fine.
Screenshot of menu:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您所描述的称为“快速行动”。这实际上是一个用户界面模式 - 没有现有的小部件或 API 中的任何内容。他们在 Google IO 上对此进行了讨论(参见此 视频在这里,在 15:40 标记),并且也有一些关于如何在堆栈溢出上实现它的讨论,特别是 这个问题。如果您开始四处挖掘(现在您知道了要查找的内容的名称),您可能会发现更多。
What you are describing is called a 'Quick Action'. This is actually a user interface pattern - there isn't an existing widget or anything in the API for this. They discussed it at Google IO (See in this video here, at the 15:40 mark), and also there has been some discussion on how to implement it on stack overflow, specifically this question. If you start digging around (now that you know the name of what you are looking for) you might find more.
您可以在
https://github.com/cyrilmottier/GreenDroid
中找到“QuickAction”小部件,下面是一个演示活动
https://github。 com/cyrilmottier/GreenDroid/blob/master/GDCatalog/src/com/cyrilmottier/android/gdcatalog/QuickActionActivity.java
you can find "QuickAction" widget in
https://github.com/cyrilmottier/GreenDroid
below is a demo activity
https://github.com/cyrilmottier/GreenDroid/blob/master/GDCatalog/src/com/cyrilmottier/android/gdcatalog/QuickActionActivity.java
请从这里找到代码或框架:
http:// /www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
Please find the code OR framework from here :
http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
联系人的源代码是开源的。你应该环顾四周,看看是否能找到它。
https://android.googlesource.com/platform/packages/apps/Contacts
我现在正在寻找,如果找到我会编辑。
The source code for the contacts is open source. You should look around here and see if you can find it.
https://android.googlesource.com/platform/packages/apps/Contacts
I'm looking now if I find it I will edit.