现在的位置: 首页 > 移动开发 > 正文

android.app.ActionBar介绍

2019年05月20日 移动开发 ⁄ 共 1628字 ⁄ 字号 评论关闭

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是独特和独立的。

 

 

 

抱歉!评论已关闭.