0
我這種提取物直接複製從Android在線文檔Styling the Action Bar樣式化操作欄兼容性
對於Android的3.0和更高版本僅
在支持Android 3.0的,只有更高,您可以定義操作欄的背景是這樣:
res/values/themes.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme"
parent="@android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar"
parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">@drawable/actionbar_background</item>
</style>
</resources>
我的minSdk是11,但我在父標籤處收到兼容性警告。爲什麼?
你是說在文檔中有錯誤嗎? – user2798694
是的,DarkActionBar是SDK 14+ – Spotlight
你能告訴我一個如何解決它的例子嗎? – user2798694