android far菜单,Android菜单详解(四)——应用高低文菜单ContextMenu(国外英语资料).doc...

Android菜单详解(四)——应用高低文菜单ContextMenu(国外英语资料)

Android菜单详解(四)——使用上下文菜单ContextMenu

The Android menu is detailed (4) -- using the context menu ContextMenu

Before the Android menu, (2) - create and respond to the options menu "and" Android menu, (3) - SubMenu and IconMenu explained in detail in the options menu, SubMenu and icon menu. Today we're going to talk about another Menu that is widely used -- the Context Menu, Context Menu.

ContextMenu profile

In Windows, we have become accustomed to right-click on the file to execute the "open", "rename", "shear", "delete" operation, such as the right-click popup menu is the context menu. You might laugh, "haha, you don't even have shortcuts." It is. Well, this... Let me give you an example. Sure, the shortcuts in Windows can help us to improve our efficiency, but this isn't working in android. Note: android's context menu items can't be keyboard shortcuts. Because mobile operating mode and the use of the mouse PC operating in a different way, the android is through long according to a view element to pop up the context menu (PS: now most smartphones is full of touch screen, no physical keyboard, no need to use shortcuts, the innovation can be attributed to jobs in 07 revolutionary iPhone, retired old Joe and salute to him!) It is. In addition, even ICONS and submenus can't be used in the context menu item for Android. So, how does the context menu for Android work? See below

As shown in figure, the context Menu inherits the android.view.menu, so we can add Menu items to the context Menu as we did with the Options Menu. The biggest difference between the context Menu and the Options Menu is that the owner of the Options Menu is the Activity, and the owner of the context Menu is the View in the Activity. Each Activity has one and only one Options Menu, which serves the entire Activity. And an Activity tends to have multiple views, not every View has a context menu, which requires that we specify it by registerForContextMenu (View View).

Although the context menu of the ow

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值