MenuItem的setAsAction四种属性解析

ifRoom

Only place this item in the app bar if there is room for it. If there is not room for all the items marked "ifRoom", the items with the lowest orderInCategory values are displayed as actions, and the remaining items are displayed in the overflow menu.

仅当app bar有足够位置时添加到上面,若没有足够的位置放置所有的设置成ifRoom的项,则拥有最小orderInCategory 值得子项被放置到app bar上面,其他的作为菜单进行显示

withText

Also include the title text (defined by android:title) with the action item. You can include this value along with one of the others as a flag set, by separating them with a pipe |.

将该项显示在app bar上面并显示其中的标题文本,你可以将这个与其他三个一起使用,用|分隔

never

Never place this item in the app bar. Instead, list the item in the app bar's overflow menu.

不将这个item放置到app bar上面,只是将其作为菜单

always

Always place this item in the app bar. Avoid using this unless it's critical that the item always appear in the action bar. Setting multiple items to always appear as action items can result in them overlapping with other UI in the app bar.

总是将其显示在app bar上面,除非该item非常重要否则不要设置此选项,将多个item设置成此选项将导致其与其他app bar上面的UI想覆盖

collapseActionView

The action view associated with this action item (as declared by android:actionLayout or android:actionViewClass) is collapsible.

将其折叠成普通菜单项进行显示
Introduced in API Level 14.

API 14被引用

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值