AndroidBar返回为NULL。是因为values-v11和values-v14下面的style的主题的设置的原因。

在SDK 11的设备上,会使用第二处,SDK 14会使用第三处。

只需要将三个地方的主题分别设置就可以,结构如下:

values--------

<resources>

    <!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style> <!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style> </resources>

values-v11--------

<resources>

    <!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
<!-- API 14 theme customizations can go here. -->
<item name="android:actionBarStyle">@style/my_actionbar_style</item>
</style> <style name="my_actionbar_style" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#ff8c00</item>
<item name="android:titleTextStyle">@style/AcBar_titleStyle</item>
<item name="android:displayOptions">showTitle</item>
</style> <style name="AcBar_titleStyle">
<item name="android:textColor">#FFFFFF</item>
<item name="android:textSize">20sp</item>
</style> <style name="AppTheme" parent="AppBaseTheme"></style>
</resources>

values-v14--------

<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
<item name="android:actionBarStyle">@style/my_actionbar_style</item>
</style> <style name="my_actionbar_style" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#ff8c00</item>
<item name="android:titleTextStyle">@style/AcBar_titleStyle</item>
<item name="android:displayOptions">showTitle</item>
</style>
<style name="AcBar_titleStyle">
<item name="android:textColor">#FFFFFF</item>
<item name="android:textSize">20sp</item>
</style>
<style name="AppTheme" parent="AppBaseTheme"></style>
</resources>
主要注意红色部分

Android ActionBar 返回为NULL的更多相关文章

  1. Android ActionBar详解

    Android ActionBar详解 分类: Android2014-04-30 15:23 1094人阅读 评论(0) 收藏 举报 androidActionBar   目录(?)[+]   第4 ...

  2. Android ActionBar完全解析,使用官方推荐的最佳导航栏(下) .

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/25466665 本篇文章主要内容来自于Android Doc,我翻译之后又做了些加工 ...

  3. Android ActionBar完全解析,使用官方推荐的最佳导航栏(上)

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/18234477 本篇文章主要内容来自于Android Doc,我翻译之后又做了些加工 ...

  4. Android ActionBar全然解析,使用官方推荐的最佳导航栏(上)

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/18234477 本篇文章主要内容来自于Android Doc.我翻译之后又做了些加工 ...

  5. 【转】Android ActionBar完全解析,使用官方推荐的最佳导航栏(上)

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/18234477 本篇文章主要内容来自于Android Doc,我翻译之后又做了些加工 ...

  6. Android ActionBar(转)

    本文内容 关于 ActionBar 必要条件 项目结构 环境 演示一:Action Bar 显示隐藏 演示二:Action Item 显示菜单选项 演示三:Action Home 启用“返回/向上”程 ...

  7. Android ActionBar应用实战,高仿微信主界面的设计

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/26365683 经过前面两篇文章的学习,我想大家对ActionBar都已经有一个相对 ...

  8. android双击返回键退出程序

    今天给大家简单说一下,android双击返回键退出程序. @Override public boolean onKeyDown(int keyCode, KeyEvent event) {      ...

  9. Android 原生 Android ActionBar

    本文内容 关于 ActionBar 必要条件 项目结构 环境 演示一:Action Bar 显示隐藏 演示二:Action Item 显示菜单选项 演示三:Action Home 启用"返回 ...

随机推荐

  1. ossim/zabbix/logstash

    http://dl528888.blog.51cto.com/2382721/1639579 http://307033.blog.51cto.com/297033/473666 http://lym ...

  2. ural 1348 Goat in the Garden 2

    http://acm.timus.ru/problem.aspx?space=1&num=1348 #include <cstdio> #include <cstring&g ...

  3. Delphi EurekaLog 调试内存泄露方法

    要使用EurekaLog进行内存泄露检测,需要手动开启"EurekaLog Options..."下的"Advanced Options"旁的"Mem ...

  4. Android动画效果

    layout_left_in.xml <?xml version="1.0" encoding="utf-8"?> <layoutAnimat ...

  5. C++中的string类(1)

    http://blog.sina.com.cn/s/blog_51409e8f01009h7g.html 前言: string 的角色1 string 使用1.1 充分使用string 操作符1.2 ...

  6. Java_XML操作

    xml的写: code: import java.io.File; import java.io.StringWriter; import javax.xml.parsers.DocumentBuil ...

  7. html中显示xml

    在工作中经常会遇到一些特殊的要求,比如在html中显示xml,xml的格式跟html很相似,同样包含了标签.属性.值,所以xml的标签等内容会在html中被转义 如果要在html中让xml的内容(包括 ...

  8. DevExpress之进度条

    progressBarControl和marqueeProgressBarControl 一.progressBarControl progressBarControl是一个进度条控件 几个重要参数 ...

  9. 【更新日志】售后CP更新日志

    记录一下: [售后CP更新日志] ============================================ 更新时间:[-- :] 更新内容: .版本升级,框架升级,框架升级版本3. ...

  10. 只要关闭浏览器,session就消失了

    程序一般都是在用户做log off的时候发个指令去删除session,然而浏览器从来不会主动在关闭之前通知服务器它将要被关闭,因此服务器根本不会有机会知道浏览器已经关闭.服务器会一直保留这个会话对象直 ...