2013-08-24 65 views
0

我已經使用Android的資產工作室產生動作條的風格,但是我竟被喜歡做一些改變,我無法在工作室做的,所以我編輯生成的題材但很多事情只是忽略了,我只是無法弄清楚是如何工作的。 有例如: `變化所產生的動作條主題從Android的資產工作室

<style name="Theme.Myactionbar" parent="@style/Theme.AppCompat.Light"> 
    <item name="actionBarItemBackground">@drawable/selectable_background_myactionbar</item> 
    <item name="popupMenuStyle">@style/PopupMenu.Myactionbar</item> 
    <item name="dropDownListViewStyle">@style/DropDownListView.Myactionbar</item> 
    <item name="actionBarTabStyle">@style/ActionBarTabStyle.Myactionbar</item> 
    <item name="actionDropDownStyle">@style/DropDownNav.Myactionbar</item> 
    <item name="actionBarStyle">@style/ActionBar.Solid.Myactionbar</item> 
    <item name="actionModeBackground">@drawable/cab_background_top_myactionbar</item> 
    <item name="actionModeSplitBackground">@drawable/cab_background_bottom_myactionbar</item> 
    <item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Myactionbar</item> 


</style> 

<style name="ActionBar.Solid.Myactionbar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid"> 
    <item name="background">@drawable/ab_solid_myactionbar</item> //THIS IS GREEN 
    <item name="backgroundStacked">@drawable/ab_solid_myactionbar</item>//THIS IS GREEN 
    <item name="backgroundSplit">@drawable/ab_bottom_solid_myactionbar</item>//THIS IS GREEN 
    <item name="progressBarStyle">@style/ProgressBar.Myactionbar</item> 
</style> 

<style name="ActionBar.Transparent.Myactionbar" parent="@style/Widget.AppCompat.Light.ActionBar"> 
    <item name="background">@drawable/ab_transparent_myactionbar</item> 
    <item name="progressBarStyle">@style/ProgressBar.Myactionbar</item> 
</style> 

<style name="PopupMenu.Myactionbar" parent="@style/Widget.AppCompat.Light.PopupMenu"> 
    <item name="android:popupBackground">@drawable/menu_dropdown_panel_example </item> 
</style> 

<style name="DropDownListView.Myactionbar" parent="@style/Widget.AppCompat.Light.ListView.DropDown"> 
    <item name="android:listSelector">@drawable/selectable_background_myactionbar</item> 
</style> 

<style name="ActionBarTabStyle.Myactionbar" parent="@style/Widget.AppCompat.Light.ActionBar.TabView"> 
    <item name="android:background">@drawable/tab_indicator_ab_myactionbar</item> 
</style> 

<style name="DropDownNav.Myactionbar" parent="@style/Widget.AppCompat.Light.Spinner.DropDown.ActionBar"> 
    <item name="android:background">@drawable/spinner_background_ab_myactionbar</item> 
    <item name="android:popupBackground">@drawable/menu_dropdown_panel_myactionbar</item> 
    <item name="android:dropDownSelector">@drawable/selectable_background_myactionbar</item> 
</style> 

<style name="ProgressBar.Myactionbar" parent="@style/Widget.AppCompat.ProgressBar.Horizontal"> 
    <item name="android:progressDrawable">@drawable/progress_horizontal_myactionbar</item> 
</style> 

<style name="ActionButton.CloseMode.Myactionbar" parent="@style/Widget.AppCompat.Light.ActionButton.CloseMode"> 
    <item name="android:background">@drawable/btn_cab_done_myactionbar</item> 
</style> 

<!-- this style is only referenced in a Light.DarkActionBar based theme --> 
<style name="Theme.Myactionbar.Widget" parent="@style/Theme.AppCompat"> 
    <item name="popupMenuStyle">@style/PopupMenu.Myactionbar</item> 
    <item name="dropDownListViewStyle">@style/DropDownListView.Myactionbar</item> 
</style> 

一切都像發電機,但後來我想最簡單的變化,即顏色,所以我編輯樣式名稱= ActionBar.Solid.Myactionbar放還有其他可生成的風格的其他drawable。 它是這樣的:

<style name="Theme.Myactionbar" parent="@style/Theme.AppCompat.Light"> 
    <item name="actionBarItemBackground">@drawable/selectable_background_myactionbar</item> 
    <item name="popupMenuStyle">@style/PopupMenu.Myactionbar</item> 
    <item name="dropDownListViewStyle">@style/DropDownListView.Myactionbar</item> 
    <item name="actionBarTabStyle">@style/ActionBarTabStyle.Myactionbar</item> 
    <item name="actionDropDownStyle">@style/DropDownNav.Myactionbar</item> 
    <item name="actionBarStyle">@style/ActionBar.Solid.Myactionbar</item> 
    <item name="actionModeBackground">@drawable/cab_background_top_myactionbar</item> 
    <item name="actionModeSplitBackground">@drawable/cab_background_bottom_myactionbar</item> 
    <item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Myactionbar</item> 


</style> 

<style name="ActionBar.Solid.Myactionbar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid"> 
    <item name="background">@drawable/ab_solid_example</item> 
    <item name="backgroundStacked">@drawable/ab_stacked_solid_example</item> 
    <item name="backgroundSplit">@drawable/ab_bottom_solid_myactionbar</item> 
    <item name="progressBarStyle">@style/ProgressBar.Myactionbar</item> 
</style> 

但沒有happend,並改變應該是灰色的繪圖資源。我是遊蕩,如果有人這樣做之前,爲什麼這個心不是工作?謝謝

回答

1

你好吧,我想通了,有價值觀V14文件夾樣式API等級14以上,所以你必須得改變這些值。