官方原文:http://developer.android.com/training/basics/actionbar/styling.html

针对3.0以上的版本:

<?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.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/CustomBackground</item>
</style> <style name="CustomBackground" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">@drawable/actionbar_background</item>
</style> <style
name="CustomActionBarOverlayTheme"
parent="@android:style/Theme.Holo"
>
<item name="android:windowActionBarOverlay">true</item> </style> </resources>

针对3.0以下版本:要导入v7兼容包。

<?xml version="1.0" encoding="utf-8"?>
<resources> <style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarStyle">@style/CustomBackground</item>
</style> <style name="CustomBackground" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">@drawable/actionbar_background</item>
</style> <style
name="CustomActionBarOverlayTheme"
parent="@style/Theme.AppCompat"
>
<item name="windowActionBarOverlay">true</item> </style> </resources>

自定义ActionBar背景(分别针对3.0以下和3.0以上的版本)的更多相关文章

  1. 自定义actionbar标题

    这是我自己封装的一个activity,主要作为所有Activity的基类,可以一键关掉所有的activity, 并共享一个自定义actionbar.直接切入主题吧. 第一步就是创建自定义标题的布局文件 ...

  2. [安卓] 18、一个简单的例子做自定义动画按钮和自定义Actionbar

    在做安卓UI的时候有时候需自定义具有动画效果的按钮或需要自定义一下actionbar~ 本节用一个简单的demo讲如何自定义具有动画效果的按钮,以及个性化的actionbar 下面是效果: 其中: △ ...

  3. Android 自定义ActionBar

    Android 3.0及以上已经有了ActionBar的API,可以通过引入support package在3.0以下的平台引用这些API,但这儿呢,完全自定义一个ActionBar,不用引入额外ja ...

  4. ActionBar官方教程(11)自定义ActionBar的样式(含重要的样式属性表及练习示例)

    Styling the Action Bar If you want to implement a visual design that represents your app's brand, th ...

  5. Android自定义ActionBar

    Android 3.0及以上已经有了ActionBar的API,可以通过引入support package在3.0以下的平台引用这些API,但这儿呢,完全自定义一个ActionBar,不用引入额外ja ...

  6. 基于HTML5自定义文字背景生成QQ签名档

    分享一款利用HTML5实现的自定义文字背景应用,首先我们可以输入需要显示的文字,并且为该文字选择一张背景图片,背景图片就像蒙版一样覆盖在文字上.点击生成QQ签名档即可将文字背景融为一体生成另外一张图片 ...

  7. (转)Android 自定义 spinner (背景、字体颜色)

    Android 自定义 spinner (背景.字体颜色) (2012-07-04 17:04:44)   1.准备两张图片,并做好9.png   2.在drawable中定义spinner_sele ...

  8. Android——自定义Actionbar左侧覆盖不全的解决方案

    今天遇到一个很蛋疼的问题,就是在自定义Actionbar的时候,setCustomView中,自定义的view怎么也覆盖不了整个视图,左侧一直留有一个空白,看下图: 所写的部分代码如下: protec ...

  9. Android中自定义ActionBar的背景色等样式style

    Android中想要去自定义ActionBar的背景色等样式. [折腾过程] 1.自己找代码,发现对应的配置的地方了: AndroidManifest.xml ? 1 2 <applicatio ...

随机推荐

  1. Problem A Where is the Marble?(查找排序)

    题目链接:Problem A 题意:有n块大理石,每个大理石上写着一个非负数,首先把数从小到大排序,接下来有Q个问题,每个问题是是否有某个大理石上写着x,如果有,则输出对应的大理石编号. 思路:先排序 ...

  2. JS数组方法总结

    数组的常用方法总结   不改变原数组 1.Array.length;                       //获取数组长度 2.Array.join();                   ...

  3. mysql 组合索引

    MySQL单列索引是我们使用MySQL数据库中经常会见到的,MySQL单列索引和组合索引的区别可能有很多人还不是十分的了解,下面就为您分析两者的主要区别,供您参考学习. 为了形象地对比两者,再建一个表 ...

  4. A Byte of Python 笔记(2)基本概念:数、字符串、转义符、变量、标识符命名、数据类型、对象

    第4章 基本概念 字面意义上的常量 如5.1.23.9.23e-3,或者 'This is a string'."It's a string!" 字符串等 常量,不能改变它的值 数 ...

  5. 给内置对象或自定义对象添加存取器属性(getter setter)的方法总结

    funct = { get: function() { return this._x }, set: function(value) { this._x = value } } function Ob ...

  6. Spring Boot普通类调用bean

    1 在Spring Boot可以扫描的包下 假设我们编写的工具类为SpringUtil. 如果我们编写的SpringUtil在Spring Boot可以扫描的包下或者使用@ComponentScan引 ...

  7. Mobile上的viewport及各种概念澄清贴

    device Pixel & CSS Pixel 物理像素指显示设备上的物理像素点,比如HTC G11宽是480px,这的480是用物理像素衡量的. CSS像素的话则指我们写页面时理解的那个像 ...

  8. swift3.0 hello swift(1)

    一直对swift感兴趣,在前段时间的新闻中,大多是swift3.0发布和xcode8.0的改进,因为改动比较大,以前使用swift2.x做项目的人,都在担心其项目从2.x迁移到3.0+的问题.以前简单 ...

  9. grunt用来压缩前端脚本

    grunt作为一个任务管理工具,提供丰富的插件和强大的自动化管理功能.需要安装node及npm. 主要使用到两个文件,一个是npm的依赖配置文件package.json { "name&qu ...

  10. 悬浮二维码 QQ ToTop

    //回顶部 <div id="lqdbe" style="position: absolute; visibility: visible; z-index: 1;  ...