动作条出现在不同的颜色具有不同的Andr​​oid版本 [英] ActionBar appearing in different colors with different versions of Android

查看:270
本文介绍了动作条出现在不同的颜色具有不同的Andr​​oid版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题看似简单,但没有什么像CHEI这里之前。所以你去:

I know the question seems simple, but not anything like chei here before. So there you go:

在使用支持库与应用程序兼容性V7我的Andr​​oid应用程序,添加了动作条。一切完美,只是当应用程序在Android 2.3上运行,在ActionBar的背景是黑色的,而当挤压安卓4.0.2动作条这样的背景变为灰色。

In my android application using the Support Library with AppCompat v7, added an ActionBar. Everything works perfectly, except that when the application runs on android 2.3, the background of the ActionBar is dark, and when the squeegee android 4.0.2 ActionBar this background turns gray.

下面是如何定义我的@style

Below is how to define my @style

<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="@style/Theme.AppCompat.Light.DarkActionBar">
        <!--
            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>

我怎么能解决这个问题?

how can I solve this?


推荐答案

这不会为你分钟目标作为工作2.3.3如果你的分钟目标是API级别11你可以改变背景颜色

This will not work for you on min target as 2.3.3 in case your min target is API level 11 you can change the background color

<resources>
    <style name="AppTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
    </style>

    <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:background">ANY_HEX_COLOR_CODE</item>
    </style>
</resources>

这篇关于动作条出现在不同的颜色具有不同的Andr​​oid版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆