Android UI ActionBar功能-自动隐藏 Action Bar
来源:互联网 发布:把mac照片怎么传邮箱 编辑:程序博客网 时间:2024/06/06 07:40
为了使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"
然后查看效果:
0 0
- Android UI ActionBar功能-自动隐藏 Action Bar
- Android UI ActionBar功能-在 Action Bar 上添加按钮
- Android UI ActionBar功能-自定义 Action Bar 样式
- Android UI ActionBar功能-Action Bar 左上角的向上或返回按钮
- Android UI--Action Bar
- Using the Android action bar (ActionBar) - Tutorial
- Android UI ActionBar功能-启动ActionBar
- android隐藏标题栏(Action Bar)
- Android笔记 - UI Menu (3) Action Bar
- Android UI开发——Action Bar
- Android笔记 - UI Menu (3) Action Bar
- Android UI开发——Action Bar
- Android UI开发之Action Bar
- Android Action Bar【高级UI学习】
- Android 技巧 - 自动生成 Action Bar Theme
- Android UI ActionBar功能-自定义Tab功能
- Android UI ActionBar功能-ActionBarProvider的使用
- Android UI ActionBar功能-ActionBarSherlock 的使用
- 新版UBOOT启动流程
- USACO 2.4 Fractions to Decimals (模拟)
- poj 1222 EXTENDED LIGHTS OUT 【高斯消元】
- 在应用层通过spring特性解决数据库读写分离
- HDU2069(二维母函数)
- Android UI ActionBar功能-自动隐藏 Action Bar
- 同余问题(1)
- 《操作系统》总结五(I/O管理)
- 牛人的专栏,包括了几款主流开发板的支持文章
- 开始怀念
- unity官方demo学习之Stealth(三)标签管理
- 谱聚类(NJW算法 Matlab代码)
- Java微信公众号开发--开发环境的搭建
- C/C++中typedef关键字总结