android中menu.add()的使用
2013-11-16 21:22
316 查看
public boolean onCreateOptionsMenu(Menu menu) {
// 增加一个选择菜单,点击手机“设置”键时弹出
menu.add(0, 1, 1, "退出");
return super.onCreateOptionsMenu(menu);
}
附:
见原文:
add(int
groupId, int itemId,int order,CharSequence title)
// 增加一个选择菜单,点击手机“设置”键时弹出
menu.add(0, 1, 1, "退出");
return super.onCreateOptionsMenu(menu);
}
附:
add(int groupId, int itemId, int order, CharSequence title) groupId 组标示符应该是这个项(item)的一部分。可以用来定义项(items)中批量状态改变的组。如果一个项(item)不应该在一组一般使用NONE。 itemId 唯一的项ID。如果你不需要一个唯一ID,可以用NONE。 order 项(item)的排序,如果不需要排序可以使用NONE。 title 项(item)显示的文本。
见原文:
add(int
groupId, int itemId,int order,CharSequence title)
groupld | The group identifier that this item should be part of. This can be used to define groups of items for batch state changes. Normally useNONE if an item should not be in a group. |
---|---|
itemId | Unique item ID. Use NONEif you do not need a unique ID. |
order | The order for the item. Use NONEif you do not care about the order. See getOrder(). |
title | The text to display for the item. |
相关文章推荐
- 使用PHP中破解md5密码(循环:10万个/3秒)
- 多线程编程:何时使用同步类
- ASP.NET中使用托管组件
- vc知识积累(3.动态链接库使用)
- C#中使用HashTable
- [原创]SQL Server 2005:一个使用新创建的User的问题和解决方法
- JSP/SERVLET入门教程--Servlet 使用入门
- JavaScript使用正则表达式 (转)
- ASP.NET 2.0使用FCKEditor初體驗
- ORACLE如何使用DBMS_METADATA.GET_DDL获取DDL语句
- 使用System.Text.RegularExpression中的API实现网页数据的抓取
- 在SharePoint中模板中实现类似框架的结构:使用Splitter分割导航与内容区,拖动调整大小(一)
- 达芬奇开发_烧写Flash:方案一:使用ramdisk,烧写到nor flash,文件格式ext2
- 使用LINQ来简化编程的7个技巧
- 在JSP中使用JavaMail
- CListCtrl 使用技巧(完整版)
- PayPal注册及使用详解
- /etc/xinetd.d 的使用
- (转)使用公用表表达式的递归查询(SQLSERVER2005)
- word宏使用