首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何与custome操作栏工作?

如何与custome操作栏工作?
EN

Stack Overflow用户
提问于 2015-06-30 10:01:56
回答 1查看 56关注 0票数 1

目前正在使用API-21.想要使用。

我试过这个:

theme.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="CustomActionBarTheme"
        parent="@style/Theme.AppCompat.Light.DarkActionBar">
        <item name="android:actionBarStyle">@style/MyActionBar</item>


        <item name="actionBarStyle">@style/MyActionBar</item>
    </style>


    <style name="MyActionBar"
        parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
        <item name="android:background">#00ffcc</item>


        <item name="background">@drawable/actionbar_background</item>-->
    </style>


</resources>

但是android给出了一个错误:在3.0或更高版本的上工作

API-11有什么不同的风格吗?

我的最小sdk - 11目标sdk -21

这是我的秤:

代码语言:javascript
复制
android {
    compileSdkVersion 22
    buildToolsVersion '19.1.0'
    defaultConfig {
        applicationId ''
        minSdkVersion 11
        targetSdkVersion 21
        versionCode 1411005

    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-06-30 10:13:02

我正在用这个,但它对我来说很好。

代码语言:javascript
复制
<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>

我的宣言:

代码语言:javascript
复制
    <uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="21" />
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31135227

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档