0
正如標題所述,在使用Android Studio v1.0.2(以及最新的Beta版本)時,我的自定義ActionBar主題/樣式並未在preivew設計窗格中應用,儘管它們一旦我部署,就會顯示在我的應用中。我瞄準棒棒糖。Android ActionBar樣式不呈現 - Android Studio
這是什麼,這是我如何配置我的樣式或渲染問題的結果?
的AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/ActionBarTheme" >
...
</application>
Styles.xml(V21)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="ActionBarTheme"
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">#FFF37022</item>
</style>
</resources>
所需的效果是把動作條背景橙色,並且它是在預覽窗格中簡單地黑儘管是正確的一旦部署到設備。
我認爲你應該使用Appcompat而不是holo,因爲你的目標是棒棒糖。 – 2015-02-12 05:50:39