如何在操作栏中创建弹出菜单?我在Api 9级工作。 [英] How Can I Create A Pop Up Menu In Action Bar?I Am Working In Api Level 9.

查看:81
本文介绍了如何在操作栏中创建弹出菜单?我在Api 9级工作。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在操作栏中创建弹出菜单?我在api级别9工作。

How can i create a pop up menu in action bar?I am working in api level 9.

推荐答案

初始化ActionBar后,您可以接收触发事件在
After initializing the ActionBar, you can receive trigger event in
ActionBar.OnNavigationListener

http:// developer .android.com / reference / android / app / ActionBar.OnNavigationListener.html [ ^ ]

然后您可以弹出AlertDialog作为上下文菜单。您可以通过

http://developer.android.com/reference/android/app/ActionBar.OnNavigationListener.html[^]
Then you can popup an AlertDialog as a context menu. You can initialize the AlertDialog by

setContentView(View view)


也许您正在寻找上下文菜单 [ ^ ]。

请参阅: http://developer.android.com/reference/android/view/ContextMenu.html [ ^ ]

http://www.mikeplate.com/2010/01/21/show-a-context-menu-for -long-clicks-in-an-android-listview / [ ^ ]



-KR
Maybe you're looking for Context Menu[^].
See this : http://developer.android.com/reference/android/view/ContextMenu.html[^]
http://www.mikeplate.com/2010/01/21/show-a-context-menu-for-long-clicks-in-an-android-listview/[^]

-KR


这篇关于如何在操作栏中创建弹出菜单?我在Api 9级工作。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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