0

我正在嘗試樣式的ActionBar。我在值文件夾中創建了我的自定義樣式。找不到錯誤。我運行我的應用程序,它工作正常。但是,我的自定義樣式不起作用,我不知道爲什麼。我做了所有我想要的改變。在清單 android:theme="@style/Theme.AndroidDevelopers"自定義樣式的ActionBar被忽略(不起作用)

我宣佈活動主題,當我運行它,應用程序會出現一個醜陋的動作條(背景灰度,彈出菜單中灰色和黑色文本...默認的藍色方案) - 它與我的自定義風格無關:

<?xml version="1.0" encoding="utf-8"?> 
     <resources> 
     <style name="Theme.AndroidDevelopers" parent="android:style/Theme.Holo.Light"> 
     <item name="android:selectableItemBackground">@drawable/ab_item_background</item> 
     <item name="android:popupMenuStyle">@style/MyPopupMenu</item> 
     <item name="android:dropDownListViewStyle">@style/MyDropDownListView</item> 
     <item name="android:actionBarTabStyle">@style/MyActionBarTabStyle</item> 
     <item name="android:actionDropDownStyle">@style/MyDropDownNav</item> 
     <item name="android:listChoiceIndicatorMultiple">@color/amarelo</item> 
     <item name="android:listChoiceIndicatorSingle">@color/vermelho</item> 
    </style> 

<!-- style the list navigation --> 
<style name="MyDropDownNav" parent="android:style/Widget.Holo.Light.Spinner"> 
<item name="android:background">@color/vermelho</item> 
<item name="android:popupBackground">@color/orange</item> 
<item name="android:dropDownSelector">@drawable/seletor2</item> 
    </style> 

<!-- style for the tabs --> 
<style name="MyActionBarTabStyle" parent="android:style/Widget.Holo.Light.ActionBar.TabView"> 
<item name="android:background">@color/verdeclaro</item> 
<item name="android:paddingLeft">32dp</item> 
<item name="android:paddingRight">32dp</item> 
</style> 

    <!-- style the overflow menu --> 
<style name="MyPopupMenu" parent="android:style/Widget.Holo.Light.ListPopupWindow"> 
<item name="android:popupBackground">@color/branco</item> 
</style> 

<!-- style the items within the overflow menu --> 
<style name="MyDropDownListView" parent="android:style/Widget.Holo.ListView.DropDown"> 
<item name="android:listSelector">@drawable/seletor2</item> 
</style> 

<style name="MyActionBar" parent="android:style/Widget.Holo.Light.ActionBar"> 
<item name="android:background">@drawable/actionbarbackground</item> 
</style> 
</resources>` 
+0

看看這個答案就不得不提到單獨'項目name's支持庫http://stackoverflow.com/a/27847656/4387543 – Omkar

回答