ActionBar官方教程(5)ActionBar的分裂模式(底部tab样式),隐藏标题,隐藏图标
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:
- 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). - 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样式),隐藏标题,隐藏图标的更多相关文章
- ActionBar官方教程(10)ActionBar的下拉列表模式
Adding Drop-down Navigation As another mode of navigation (or filtering) for your activity, the acti ...
- ActionBar官方教程(9)ActionBar的顶部tab模式(注意,已经被弃用)
This interface is deprecated.Action bar navigation modes are deprecated and not supported by inline ...
- ActionBar官方教程(11)自定义ActionBar的样式(含重要的样式属性表及练习示例)
Styling the Action Bar If you want to implement a visual design that represents your app's brand, th ...
- ActionBar官方教程(2)选主题让应用支或不支持ActionBar及支持ActionBar的应用如何隐藏和显示
Adding the Action Bar As mentioned above, this guide focuses on how to use the ActionBar APIs in the ...
- 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 ...
- ActionBar官方教程(3)更改标题处的图片
Using a logo instead of an icon By default, the system uses your application icon in the action bar, ...
- ActionBar官方教程(1)简介及各区域介绍
Action Bar The action bar is a window feature that identifies the user location, and provides user a ...
- ActionBar官方教程(8)ShareActionProvider与自定义操作项提供器
Adding an Action Provider Similar to an action view, an action provider replaces an action button wi ...
- ActionBar官方教程(7)自定义操作项的view,如何得到它及处理它的事件
Adding an Action View An action view is a widget that appears in the action bar as a substitute for ...
随机推荐
- Install GTK in Ubuntu
reference: http://www.cnblogs.com/niocai/archive/2011/07/15/2107472.html 一.安装 1.安装gcc/g++/gdb/make 等 ...
- Lodop错误汇总
代码方面 需要修改 LodopFuncs.js 里面的src地址,主要是端口号,端口号需要和服务器里面的程序的端口一样.如下: 调试错误 可以通过查看调用lodop的地方,查看lodop是否为空( ...
- spring mvc 全局异常处理
package com.tool; public class MyException extends Exception{ public String Msg; public String ErrCo ...
- C语言 宏/macor/#define/
C语言 宏/macor/#define 高级技巧 1.在进行调试的时候,需要进行打印/PRINT,可以通过define进行自定义.例如,自己最常用的DEBUG_PRINT() #define DEBU ...
- 暑假集训(2)第七弹 -----今年暑假不AC(hdu2037)
J - 今年暑假不AC Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:32768KB 64 ...
- STL的简介
Standard Template Library,(标准模板库)<来自百度百科的整理> ————可复用性(reusability) STL是基于模板,内联函数的使用使得生成的代码短小高效 ...
- 程序员面试题精选100题(16)-O(logn)求Fibonacci数列[算法]
作者:何海涛 出处:http://zhedahht.blog.163.com/ 题目:定义Fibonacci数列如下: / 0 n=0 f(n)= ...
- selenium自动化测试(1):环境搭建
Selenium是一款优秀的WEB自动化测试工具,它功能强大,易于使用,支持多种平台.多种浏览器和多种开发语言.这里介绍使用python+selenium进行自动化测试的一些基础知识. 在Window ...
- js中的in-for循环
<!doctype html><html lang="en"> <head> <meta charset="UTF-8" ...
- css3动画--超级基础知识
这么乱的笔记....供自己阅读!