💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
> 编写:[Vincent 4J](http://github.com/vincent4j) - 原文:[http://developer.android.com/training/basics/actionbar/index.html](http://developer.android.com/training/basics/actionbar/index.html) Action Bar是我们可以为[activity](# "An activity represents a single screen with a user interface.")实现的最重要的设计元素之一。其提供了多种 UI 特性,可以让我们的 app 与其他 Android app 保持较高的一致性,从而为用户所熟悉。核心的功能包括: - 一个专门的空间用来显示你的app的标识,以及指出目前所处在app的哪个页面。 - 以一种可预见的方式访问重要的操作(比如搜索)。 - 支持导航和视图切换(通过Tabs和下拉列表) ![actionbar-actions](https://box.kancloud.cn/2015-07-28_55b7246ee9c85.png) 本章为 action bar 的基本知识提供了一个快速指南。关于 action bar 的更多特性,请查看 [Action Bar](https://developer.android.com/guide/topics/ui/actionbar.html) 指南。 ### Lessons - [**建立ActionBar**](#) 学习如何为 [activity](# "An activity represents a single screen with a user interface.") 添加一个基本的 action bar,是仅仅支持 Android 3.0及以上的版本,还是同时也支持至Android 2.1的版本(通过使用 Andriod Support Library)。 - [**添加Action按钮**](#) 学习如何在 action bar 中添加和响应用户操作。 - [**ActionBar的风格化**](#) 学习如何自定义 action bar 的外观。 - [**ActionBar覆盖叠加**](#) 学习如何在布局上面叠加 action bar,允许 action bar 隐藏时无缝过渡。