Android7.0中文文档(API)-- PopupMenu

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/PopupMenu.html

PopupMenu

public class PopupMenu
extends Object

java.lang.Object
   ↳android.widget.PopupMenu


A PopupMenu displays a Menu in a modal popup window anchored to a View. The popup will appear below the anchor view if there is room, or above it if there is not. If the IME is visible the popup will not overlap it until it is touched. Touching outside of the popup will dismiss it.
PopyoMenu在模态弹出窗口中显示一个Menu,并附着在一个View上。如果有空间,则弹出窗口将显示在所附着的视图下,如果没有,则会显示在它上面。如果显示了IME,则弹出窗口将不会重叠,直到它被触摸。触摸弹出窗口外面的地方,则将会关闭弹出窗口。

摘要


嵌套类

interfacePopupMenu.OnDismissListener

Callback interface used to notify the application that the menu has closed. 
回调接口,用于通知应用程序菜单已关闭。 

interfacePopupMenu.OnMenuItemClickListener

Interface responsible for receiving menu item click events if the items themselves do not have individual item click listeners. 
如果项本身没有单独的项点击监听器,则此接口负责接收菜单项的点击事件。 

Public构造方法

PopupMenu(Context context, View anchor)

Constructor to create a new popup menu with an anchor view.
构造方法,其创建指定附着视图的一个新弹出菜单。

PopupMenu(Context context, View anchor, int gravity)

Constructor to create a new popup menu with an anchor view and alignment gravity.
构造方法,其创建指定附着视图和对齐重力参数的一个新弹出菜单。

PopupMenu(Context context, View anchor, int gravity, int popupStyleAttr, int popupStyleRes)

Constructor a create a new popup menu with a specific style.
构造方法,其创建指定样式的一个新弹出菜单。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值