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. xp 中的IIS安装成功之后,访问网页显示没有权限访问解决方法

    在做xp的IIS发布网站时遇到一个问题就是当你访问网站的时候,显示没有权限访问网站,但是我已经开启了匿名访问网站了,怎么还没有权限访问呢?后来经过上网搜资料解决,当时很多网上都说没打开匿名访问,当时我 ...

  2. 第六篇、git常用的命令

    1.oscine git服务器地址 https://git.oschina.net/ 2.帐号:18775134221@163.com 密码:562011 3.创建私有的仓库 4.使用命令 4.1 配 ...

  3. asp.net 音乐播放器

    <HTML> <HEAD><TITLE>Playback Example</TITLE> </HEAD> <BODY> < ...

  4. Easyui tabs的herf和content属性

    在backstage.jsp页面中我写了一个方法,用于在指定位置添加面板(id为msg的地方)function addTab(t,h){ if($('#msg').tabs('exists',t)){ ...

  5. 轮子来袭 vJine.Core 之 AppConfig<T>

    1.引用vJine.Core; 2.定义配置类; using System; using System.Collections.Generic; using System.Text; using Sy ...

  6. tomcat maxConnections和maxThreads区别

    maxConnections:与tomcat建立的最大socket连接数,默认10000(很多网上说200,实际上通过tomcat7.0.55源码查看可以知道是10000),AbstractEndpo ...

  7. MFC通过ADO操作Access数据库

    我在<VC知识库在线杂志>第十四期和第十五期上曾发表了两篇文章——“直接通过ODBC读.写Excel表格文件”和“直接通过DAO读.写Access文件”,先后给大家介绍了ODBC和DAO两 ...

  8. 回溯算法之n皇后问题

    今天在看深度优先算法的时候,联想到DFS本质不就是一个递归回溯算法问题,只不过它是应用在图论上的.OK,写下这篇博文也是为了回顾一下回溯算法设计吧. 学习回溯算法问题,最为经典的问题我想应该就是八皇后 ...

  9. one makefile file

    #gcc test.cpp -L. -Wl,-Bdynamic -ltestlib -Wl,-Bstatic -ltestlib -Wl,-Bdynamic #make clean; make ini ...

  10. 安装mvc3出错致命错误

    给vs2010安装mvc3,出现如下错误提示: Installation failed with error code: (0x80070643), "安装时发生严重错误 ". 将 ...