Action Bar

  The action bar is a window feature that identifies the user location, and provides user actions and navigation modes. Using the action bar offers your users a familiar interface across applications that the system gracefully adapts for different screen configurations.

  The action bar is split into four different functional areas that apply to most apps.

图中和部分如下:

1,App icon

  The app icon establishes your app's identity. It can be replaced with a different logo or branding if you wish. Important: If the app is currently not displaying the top-level screen, be sure to display the Up caret to the left of the app icon, so the user can navigate up the hierarchy. For more discussion of Up navigation, see the Navigation pattern.

  App icon with and without "up" affordance. 

2,View control

  If your app displays data in different views, this segment of the action bar allows users to switch views. Examples of view-switching controls are drop-down menus or tab controls. For more information on view-switching, see the App Structure pattern.

  If your app doesn't support different views, you can also use this space to display non-interactive content, such as an app title or longer branding information.

3,Action buttons

  Show the most important actions of your app in the actions section. Actions that don't fit in the action bar are moved automatically to the action overflow. Long-press on an icon to view the action's name.

4,Action overflow

  Move less often used actions to the action overflow.

The action bar provides several key functions:

  • Provides a dedicated space for giving your app an identity and indicating the user's location in the app.
  • Makes important actions prominent and accessible in a predictable way (such as Search).
  • Supports consistent navigation and view switching within apps (with tabs or drop-down lists).

For more information about the action bar's interaction patterns and design guidelines, see the Action Bar design guide.

The ActionBar APIs were first added in Android 3.0 (API level 11) but they are also available in the Support Library for compatibility with Android 2.1 (API level 7) and above.

This guide focuses on how to use the support library's action bar, but if your app supports only Android 3.0 or higher, you should use the ActionBar APIs in the framework. Most of the APIs are the same—but reside in a different package namespace—with a few exceptions to method names or signatures that are noted in the sections below.

Caution: Be certain you import the ActionBar class (and related APIs) from the appropriate package:

  • If supporting API levels lower than 11: 
    import android.support.v7.app.ActionBar
  • If supporting only API level 11 and higher: 
    import android.app.ActionBar

Note: If you're looking for information about the contextual action bar for displaying contextual action items, see the Menu guide.

ActionBar官方教程(1)简介及各区域介绍的更多相关文章

  1. ActionBar官方教程(11)自定义ActionBar的样式(含重要的样式属性表及练习示例)

    Styling the Action Bar If you want to implement a visual design that represents your app's brand, th ...

  2. ActionBar官方教程(10)ActionBar的下拉列表模式

    Adding Drop-down Navigation As another mode of navigation (or filtering) for your activity, the acti ...

  3. ActionBar官方教程(9)ActionBar的顶部tab模式(注意,已经被弃用)

    This interface is deprecated.Action bar navigation modes are deprecated and not supported by inline ...

  4. ActionBar官方教程(6)把图标变成一个返回到上级的按钮,同一个app间,不同app间,不同fragment间

    Navigating Up with the App Icon Enabling the app icon as an Up button allows the user to navigate yo ...

  5. ActionBar官方教程(5)ActionBar的分裂模式(底部tab样式),隐藏标题,隐藏图标

    Using split action bar Split action bar provides a separate bar at the bottom of the screen to displ ...

  6. ActionBar官方教程(3)更改标题处的图片

    Using a logo instead of an icon By default, the system uses your application icon in the action bar, ...

  7. ActionBar官方教程(2)选主题让应用支或不支持ActionBar及支持ActionBar的应用如何隐藏和显示

    Adding the Action Bar As mentioned above, this guide focuses on how to use the ActionBar APIs in the ...

  8. ContentProvider官方教程(2)简介、Content URIs

    In this document Overview Accessing a provider Content URIs Content Provider Basics A content provid ...

  9. Intent官方教程(1)简介和作用

    Intents An Intent is a messaging object you can use to request an action from another app component. ...

随机推荐

  1. Linux网络服务器epoll模型的socket通讯的实现(一)

    准备写一个网络游戏的服务器的通讯模块,参考网上看到的一些代码,在linux下面实现一个多线程的epoll模型的socket通讯的代码,以下是第一部分多线程的切换代码: 1 #include <s ...

  2. java.util.AbstractStringBuilder源码分析

    AbstractStringBuilder是一个抽象类,是StringBuilder和StringBuffer的父类,分析它的源码对StringBuilder和StringBuffer代码的理解有很大 ...

  3. slabs.c

    /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Slabs memory allo ...

  4. Linux下的ntp时钟同步问题

    前段时间,项目中有个需求,需要将linux和windows的时间进行同步,网上也有很多类似时钟同步的帖子,大致类似:不过本次的linux的机器有点特殊,没有service命令,而且要求在另一台suse ...

  5. C# 制作Zip压缩包

    压缩包制作也是很多项目中需要用到的功能.比如有大量的文件(假设有10000个)需要上传,1个1个的上传似乎不太靠谱(靠,那得传到什么时候啊?),这时我们可以制作一个压缩包zip,直接传这个文件到服务器 ...

  6. 【原】yield的最基本用法

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Itca ...

  7. 如何编写规范,灵活,稳定,高质量的HTML和css代码

    黄金定律 永远遵循同一套编码规范,不管有多少人共同参与同一项目,一定要确保每一行代码都像是同一个人编写的. 语法: 1.用两个空格来代替制表符(tab);2.嵌套元素应当缩进一次(两个空格); 3.对 ...

  8. tp数据表字段缓存

    在维护一个tp写的项目,因为需要在产品表product中增加了一个字段status,但是不论如何就是无法给status赋值,查了资料才发现,原来是tp的数据表字段缓存在搞鬼. 在runtime> ...

  9. 安装IntelliJ IDEA热部署tomcat插件JreBel

    最近试着使用IntelliJ IDEA这款IDE,网上说它是最好用的java开发工具~但奈何国内ecilpse市场占有率实在稳固,所以国内这个工具也就少数人在使用 当然使用起来跟ecilpse还是有很 ...

  10. Android开发框架

    AsyncHttpClient 它把HTTP所有的通信细节全部封装在了内部,我们只需要简单调用几行代码就可以完成通信操作 Universal-Image-Loader 它使得在界面上显示网络图片的操作 ...