为了使ActionBar不影响Activity的布局内容,我们还可以设置ActionBar,将其设置为透明,并且让Activity是头部自动空出一个ActionBar的空间:

官方文档:http://wear.techbrood.com/training/basics/actionbar/overlaying.html#EnableOverlay

在应用程序里面,我们添加了一个背景:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity" > <ImageView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg2"/> </RelativeLayout>

然后自定义一个主题values/themes.xml,继承自Theme.Holo

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="CustomActionBarTheme" parent="@android:style/Theme.Holo">
<item name="android:windowActionBarOverlay">true</item>
</style>
</resources>

这样就可以实现ActionBar是透明效果:

让其背景让出一个ActionBar的位置 ,在Activity布局文件中让其android:paddingTop="?android:attr/actionBarSize"

然后查看效果:

Android UI ActionBar功能-自动隐藏 Action Bar的更多相关文章

  1. Android UI ActionBar功能-自定义Tab功能

    还可以使用ActionBar实现Tab选项卡功能: 官方帮助文档:http://wear.techbrood.com/training/basics/actionbar/styling.html#Cu ...

  2. Android UI ActionBar功能-启动ActionBar

    官方帮助文档:http://wear.techbrood.com/training/basics/actionbar/index.html ------------------------------ ...

  3. Android UI ActionBar功能-Action Bar 左上角的向上或返回按钮

    ActionBar在左上角还提供了一个向上或返回的按钮,默认情况下是隐藏的需要在代码中开启: 官方文档:http://wear.techbrood.com/training/basics/action ...

  4. Android UI ActionBar功能-在 Action Bar 上添加按钮

    在ActionBar上添加按钮实现某些功能最常见的Application的功能如:在ActionBar上添加一个搜索按钮: 首先官方文档说明:http://wear.techbrood.com/tra ...

  5. Android UI ActionBar功能-自定义 Action Bar 样式

    ActionBar的样式官方提供了三种: Theme.Holo Theme.Holo.Light Theme.Holo.Light.DarkActionBar 但不仅仅是这三种,我们还可以自己定义Ac ...

  6. Android UI ActionBar功能-ActionBarSherlock 的使用

    ActionBarSherlock实现了在ActionBar上添加一个下拉菜单的功能,也是App常用的功能之一: ActionBarSherlock是第三方提供的一个开源类库,下载地址:http:// ...

  7. Android UI ActionBar功能-ActionBarProvider的使用

    分享功能是很多App都有一个功能,ActionBarProvider可以实现分享功能: 3.0以前的版 本和3.0以后的版 本的区别: public class MainActivity extend ...

  8. 【Android Developers Training】 6. 配置Action Bar

    注:本文翻译自Google官方的Android Developers Training文档,译者技术一般,由于喜爱安卓而产生了翻译的念头,纯属个人兴趣爱好. 原文链接:http://developer ...

  9. [Android系列—] 4. 加入操作栏(Action Bar)

    前言 操作栏是最重要的设计元素之中的一个,使用它来实现你的应用程序活动.通过提供多种用户界面功能, 使应用程序高速和其它的Andorid应用程序一致, 以便被用户熟悉和接受. 主要功能包括: 1. 标 ...

随机推荐

  1. Linux下Nginx+PHP 简单安装配置

    测试环境 Linux 2.6.18nginx-1.0.4 http://www.nginx.org/php-5.3.6 http://www.php.net/ 一,安装Nginxwget http:/ ...

  2. Inno Setup:获取isl中的多国语言字串

    原文 http://zwkufo.blog.163.com/blog/static/25882512010101041626803/?suggestedreading&wumii 用InnoS ...

  3. 方差var,标准差

    wiki摘录如下(红色字体是特别标注的部分): 方差:http://zh.wikipedia.org/wiki/%E6%96%B9%E5%B7%AE 方差 变异量(数)(Variance),应用数学里 ...

  4. UML_部署图

    一.部署图简介(Deployment Diagram Introduction) 二.部署图元素(Deployment Diagram Elements) 1.结点(Node) 2.结点实例(Node ...

  5. fabric 安装及使用

    官网地址 1.安装 pip install fabric 依赖 Paramiko .PyCrypto库 以下依赖肯能要手动安装 #安装 pycrypto 密码库pip install pycrypto ...

  6. BestCoder Round #3 A,B

    A.预处理出来,0(1)输出. Task schedule Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K ...

  7. android分割线

    http://blog.csdn.net/dekunchenivan/article/details/6640804 在Android布局文件layout中设置水平分割线: <View      ...

  8. EnyimMemcached扩展 遍历功能

    Memcached本身对外提供的命令不多,也就add.get.set.incr.decr.replace.delete.stats等几个,客户端对这些操作进行了封装,总体来说调用还是很简单的. 初看了 ...

  9. 【floyed】【HDU1217】【Arbitrage】

    题目大意: 给你几种货币,以及几种汇率关系,问是否存在套利的可能? 思路: 初步想法:图上存在一个环的路径上权值相乘大于1.... 再者:该如何找到图上所有环呢.... 好吧 经过鸟神 和 况神的指点 ...

  10. Android学习之DialogFragment

    DialogFrament是Android sdk中的对话框基类,开发人员可以针对此类进行扩展.他可以扩展出Android中的多种对话框,比如alertdialog,listdialog,radiod ...