actionbar 默认放在顶部, 如果在application或者activity中加入

android:uiOptions="splitActionBarWhenNarrow"

那么,actionbar将在底部显示。

自定义属性,包括自定义actionbar的背景颜色

 <!-- the theme applied to the application or activity -->
<style name="CustomActivityTheme" parent="@style/Theme.Base.AppCompat">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<!-- 自定义actionbar的背景颜色-->
<item name="android:actionOverflowButtonStyle">@style/MyActionButtonOverflow</item>
<!--自定义actionbar的overflow图片-->
<item name="android:actionBarDivider">@color/black</item>
<!-- 自定义actionbar的item之间的分割线-->
<item name="android:popupMenuStyle">@style/MyPopupMenu</item>
<!-- 自定义popupwindow的背景颜色-->
<!-- other activity and action bar styles here -->
</style> <!-- style for the action bar backgrounds -->
<style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:background">@color/black</item>
<item name="android:backgroundStacked">@color/black</item>
<item name="android:backgroundSplit">@color/black</item>
</style>

自定义actionbar的overflow的图片

 <style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.Light.ActionButton.Overflow">
<item name="android:src">@drawable/ic_dxhome_airplane_on</item>
<item name="android:background">?android:attr/actionBarItemBackground</item>
<item name="android:contentDescription">"Lala"</item>
</style>

自定义点击overflow弹出的popupwindow的背景颜色

<style name="MyPopupMenu" parent="android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:background">@color/white</item>
</style>

[Android UI] ActionBar 自定义属性的更多相关文章

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

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

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

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

  3. Android UI ActionBar功能-自动隐藏 Action Bar

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

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

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

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

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

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

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

  7. Android UI ActionBar功能-启动ActionBar

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

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

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

  9. 【Android UI设计与开发】8.顶部标题栏(一)ActionBar 奥义·详解

    一.ActionBar介绍 在Android 3.0中除了我们重点讲解的Fragment外,Action Bar也是一个非常重要的交互元素,Action Bar取代了传统的tittle bar和men ...

随机推荐

  1. window服务器上搭建git服务,window server git!!!

    先给大家看一个高大上的,这是我给我公司配置的,小伙伴们都说好! 阿里云的2012server 基于这篇大神的教程,我把服务端搭建好了. 传送门,当然我还是自己做个笔记的好. 1.下载java,并安装 ...

  2. 【BZOJ】3674: 可持久化并查集加强版

    题解 感觉全世界都写过只有我没写过 毕竟是板子还是挺简单的,只要用可持久化线段树维护一下数组的形态就好了,每个数组里面维护这个数组的father,和这个点所在树的最长链的深度(如果这个点是根按秩合并要 ...

  3. network出错

    1.更改IP之后,执行service network restart时出现 shutting down interface eth0:Device state :3(disconnected)的问题时 ...

  4. Jersey入门二:运行项目

    1.项目有了,在终端窗口进入项目的根目录(即 \simple-service ) 2.现在先测试运行下: mvn clean test  项目将会被编译,并且进行单元测试  上面可以看看到测试通过 ...

  5. centos7 安装 supervisor

    一.安装 supervisor yum install python-setuptools easy_install supervisor 如果easy_install不好使就从官方下载: wget ...

  6. MXNet 中的几个数据集

    from mxnet import gluon def transform(data, label): return data.astype('float32') / 255., label.asty ...

  7. luogu4407 [JSOI2009]电子字典 字符串hash + hash表

    暴力枚举,然后\(hash\)表判断 复杂度\(O(26 * 20 * n)\) 具体而言 对于操作1:暴力枚举删除 对于操作2:暴力添加,注意添加不要重复 对于操作3:暴力替换,同样的注意不要重复 ...

  8. 【MPI】并行奇偶交换排序

    typedef long long __int64; #include "mpi.h" #include <cstdio> #include <algorithm ...

  9. windows下整数溢出分析

    0x00前言 整数溢出就是往存储整数的内存单位存放的数据大于该内存单位所能存储的最大值,整数溢出有时候间接导致缓冲区溢出.如JPEG溢出漏洞(MS04-028). 0x01整数溢出分类 整数溢出可以分 ...

  10. 2013年JavaScript开发人员调查结果

    JavaScript开发人员调查现在已经结束,一如既往社区对结果进行了进一步分析: 总结(汉语) 原始数据(电子表格) 2012年结果 51%的被参与者写客户端代码,而28%的人说他们编写服务器端代码 ...