3
我想將主題應用於我的操作欄,它將更改背景顏色。然而,當我這樣做的應用程序的整個背景變化...將不同的主題應用於操作欄
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:actionBarSize">140dp</item>
<item name="android:background">#00ff00</item>
</style>
有誰知道我可以如何應用一個單獨的主題的行動欄?
謝謝。
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:actionBarSize">140dp</item>
<item name="android:background">#ffffff</item>
</style>
<!-- ActionBar LAYOUT -->
<style name="MyActionBar" parent="android:Widget.ActionBar">
<item name="android:background">#000000</item>
</style>
我收到一個錯誤說沒有資源發現的部件。動作條? – Javacadabra
對不起,應該是android:Widget.Holo.ActionBar。我編輯我的回答 – Ahmad
感謝您的更正工作,但我仍然有一個問題,改變背景顏色..作爲一個測試,我試圖設置行動欄背景爲白色和應用程序背景爲黑色,但它不工作,我我的代碼添加到我的問題。任何想法爲什麼? – Javacadabra