[英]how do work with custome actionbar?
當前正在使用API-21。 想要使用自定義操作欄。
我嘗試了這個:
theme.xml
<?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 studio給出了一個錯誤: 在3.0或更高版本上工作
API-11有什么不同的樣式嗎?
我的最低SDK-11個目標SDK -21
這是我的畢業證書:
android {
compileSdkVersion 22
buildToolsVersion '19.1.0'
defaultConfig {
applicationId ''
minSdkVersion 11
targetSdkVersion 21
versionCode 1411005
}
我正在使用它,但是對我來說很好用。
<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>
我的清單:
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.