Using split action bar

  Split action bar provides a separate bar at the bottom of the screen to display all action items when the activity is running on a narrow screen (such as a portrait-oriented handset).

Figure 3. Mock-ups showing an action bar with tabs (left), then with split action bar (middle); and with the app icon and title disabled (right).

  Separating the action items this way ensures that a reasonable amount of space is available to display all your action items on a narrow screen, while leaving room for navigation and title elements at the top.

  To enable split action bar when using the support library, you must do two things:

  1. Add android:uiOptions="splitActionBarWhenNarrow" to each <activity> element or to the <application>element. This attribute is understood only by API level 14 and higher (it is ignored by older versions).
  2. To support older versions, add a <meta-data> element as a child of each <activity> element that declares the same value for "android.support.UI_OPTIONS".
  开启分裂模式的方法:在minifest,xml的activity或application中用 android:uiOptions="splitActionBarWhenNarrow"

在activity中:

 <manifest ...>
     <activity uiOptions="splitActionBarWhenNarrow" ... >
         <meta-data android:name="android.support.UI_OPTIONS"
                    android:value="splitActionBarWhenNarrow" />
     </activity>
 </manifest>

在applicatoin中:

  <application
         android:allowBackup="true"
         android:icon="@drawable/ic_launcher"
         android:logo="@drawable/ab_me_l"
         android:label="@string/app_name"
         android:uiOptions="splitActionBarWhenNarrow"
         android:theme="@style/AppBaseTheme" >
         <activity ...

  Using split action bar also allows navigation tabs to collapse into the main action bar if you remove the icon and title (as shown on the right in figure 3). To create this effect, disable the action bar icon and title with setDisplayShowHomeEnabled(false) and setDisplayShowTitleEnabled(false).

注意:     ActionBar.setDisplayShowHomeEnabled(false) 隐藏icon  ActionBar.setDisplayShowTitleEnabled(false) 隐藏标题

ActionBar官方教程(5)ActionBar的分裂模式(底部tab样式),隐藏标题,隐藏图标的更多相关文章

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

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

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

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

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

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

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

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

  5. 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 ...

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

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

  7. ActionBar官方教程(1)简介及各区域介绍

    Action Bar The action bar is a window feature that identifies the user location, and provides user a ...

  8. ActionBar官方教程(8)ShareActionProvider与自定义操作项提供器

    Adding an Action Provider Similar to an action view, an action provider replaces an action button wi ...

  9. ActionBar官方教程(7)自定义操作项的view,如何得到它及处理它的事件

    Adding an Action View An action view is a widget that appears in the action bar as a substitute for ...

随机推荐

  1. WebClient.UploadValues Post中文乱码的解决方法

    //using (System.Net.WebClient wc = new System.Net.WebClient()) //{ // wc.Encoding = Encoding.GetEnco ...

  2. 关于ios的手势识别(GestureRecognizers)讲解

    大家都知道,苹果的设备,不管是mac机器还是iPhone或iad,都支持多点触控,进而延伸了多种手势识别的功能.这为用户带来了很大的便携性和多样灵活性,极大的方便了用户的使用.足以见手势识别(Gest ...

  3. OC5_构造方法与self指针

    // // Dog.h // OC5_构造方法与self指针 // // Created by zhangxueming on 15/6/9. // Copyright (c) 2015年 zhang ...

  4. time 函数

    1.Python Time 2.C++ Time Example: #include <iostream> #include <chrono> //C++的`计时`库 #inc ...

  5. centos svn安装

    http://fengjunoo.iteye.com/blog/1759265(参考) 以前在ubuntu上安装过一次svn,那次弄得有些麻烦. 这次记录下centos环境下安装svn的步骤 其实简单 ...

  6. Qt-获取主机网络信息之QHostInfo

    Qt中提供了几个用于获取主机网络信息的类,包括QHostInfo.QHostAddress.QNetworkInterface以及QNetworkAddress.在本节中,我将在这里总结QHostIn ...

  7. Python3 网络编程

    虽然大家现在对互联网很熟悉,但是计算机网络的出现比互联网要早很多. 计算机为了联网,就必须规定通信协议,早期的计算机网络,都是由各厂商自己规定一套协议,IBM.Apple和Microsoft都有各自的 ...

  8. 即时Web通信总结

    即时Web通信在一些对数据实时性要求特别严格的应用中十分重要,如监控系统.报价系统.股票交易系统和即时在线聊天应用等,由于http协议设计当初是为了服务器端响应客户端的请求而设计的,只能在客户端主动发 ...

  9. 工作踩坑记录:JavaScript跳转被缓存

    起因:业务想要一个固定二维码来每周扫码跳转到不同的页面上去,我用JS写了个跳转,却发现被缓存了,虽然被具体被缓存多久不清楚,但是被缓存了很不爽,不符合业务实时更改这个二维码跳转页面的需求. 经过:既然 ...

  10. Custome Buble Data Point

    <navigation:Page xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/to ...