android.app.ActionBar介绍

android.app.ActionBar

A window feature at the top of the activity that may display the activity title, navigation modes, and other interactive items.

活动顶部的一个特性,可以显示活动的标题,导航模式和其它可以(和活动)交互的项。

Beginning with Android 3.0 (API level 11), the action bar appears at the top of an activity's window when the activity uses the system's Holo theme (or one of its descendant themes), which is the default. You may otherwise add the action bar by calling requestFeature(FEATURE_ACTION_BAR) or by declaring it in a custom theme with the windowActionBar property.
此属性在Android3.0出现,action bar默认出现在活动窗口的顶部当活动使用系统的Holo主题时(或者它的继承主题)。你既可以通过代码调用调用FEATURE_ACTION_BAR特性来调用action bar,也可以通过指定windowActionBar属性来调用。

By default, the action bar shows the application icon on the left, followed by the activity title. If your activity has an options menu, you can make select items accessible directly from the action bar as "action items". You can also modify various characteristics of the action bar or remove it completely.
默认情况,the action bar显示在应用icon的左边,紧挨着标题。如果你的活动有一个可选菜单,你可以使选择项作为action bar的“action item”可以直接操作。你也可以action bar的各种特性或者将他们完全移除。

From your activity, you can retrieve an instance of ActionBar by calling getActionBar().
在你的活动中,可以通过调用getActionBar()函数获得ActionBar的实例。

In some cases, the action bar may be overlayed by another bar that enables contextual actions, using an ActionMode. For example, when the user selects one or more items in your activity, you can enable an action mode that offers actions specific to the selected items, with a UI that temporarily replaces the action bar. Although the UI may occupy the same space, the ActionMode APIs are distinct and independent from those for ActionBar.
在一些情况下,action bar可能被另一个有上下文关系的bar覆盖,当使用actionMode时。例如,当用户在活动中选择一个或多个项时,通过一个UI临时替换掉action bar,你可以使用action mode提供动作。虽然这个UI控件占用了同样的区域,ActionMOde APIs对于ActionBar是独特和独立的。

 

 


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值