Dowemo


Question:

how to change the top and bottom padding or margin of the action bar icon or logo space by using XML theme?

<style name="Theme.Whycheck" parent="@style/Theme.AppCompat.Light.DarkActionBar">


    <item name="actionBarItemBackground">@drawable/selectable_background_whycheck</item>


    <item name="actionBarStyle">@style/ActionBar.Solid.Whycheck</item>


    <item name="actionModeBackground">@drawable/cab_background_top_whycheck</item>


    <item name="actionModeSplitBackground">@drawable/cab_background_bottom_whycheck</item>



            <!-- Light.DarkActionBar specific -->


    <item name="actionBarWidgetTheme">@style/Theme.Whycheck.Widget</item>



</style>



<style name="ActionBar.Solid.Whycheck" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">


    <item name="background">@drawable/ab_solid_whycheck</item>


    <item name="backgroundStacked">@drawable/ab_stacked_solid_whycheck</item>


    <item name="backgroundSplit">@drawable/ab_bottom_solid_whycheck</item>


</style>



<style name="ActionBar.Transparent.Whycheck" parent="@style/Widget.AppCompat.ActionBar">


    <item name="background">@drawable/ab_transparent_whycheck</item>


</style>



<!-- this style is only referenced in a Light.DarkActionBar based theme -->


<style name="Theme.Whycheck.Widget" parent="@style/Theme.AppCompat">


</style>


Provided my styles.


Best Answer:


<style name="Theme.Whycheck" parent="@style/Theme.AppCompat.Light.DarkActionBar">


    <item name="android:actionBarItemBackground">@drawable/selectable_background_whycheck</item>


    <item name="actionBarItemBackground">@drawable/selectable_background_whycheck</item>



    <item name="android:popupMenuStyle">@style/PopupMenu.Whycheck</item>


    <item name="popupMenuStyle">@style/PopupMenu.Whycheck</item>



    <item name="android:dropDownListViewStyle">@style/DropDownListView.Whycheck</item>


    <item name="dropDownListViewStyle">@style/DropDownListView.Whycheck</item>



    <item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Whycheck</item>


    <item name="actionBarTabStyle">@style/ActionBarTabStyle.Whycheck</item>



    <item name="android:actionDropDownStyle">@style/DropDownNav.Whycheck</item>


    <item name="actionDropDownStyle">@style/DropDownNav.Whycheck</item>



    <item name="android:actionBarStyle">@style/ActionBar.Solid.Whycheck</item>


    <item name="actionBarStyle">@style/ActionBar.Solid.Whycheck</item>



    <item name="android:actionModeBackground">@drawable/cab_background_top_whycheck</item>


    <item name="actionModeBackground">@drawable/cab_background_top_whycheck</item>



    <item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_whycheck</item>


    <item name="actionModeSplitBackground">@drawable/cab_background_bottom_whycheck</item>



    <item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Whycheck</item>


    <item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Whycheck</item>



            <!-- Light.DarkActionBar specific -->


    <item name="android:actionBarWidgetTheme">@style/Theme.Whycheck.Widget</item>


    <item name="actionBarWidgetTheme">@style/Theme.Whycheck.Widget</item>


</style>



<style name="ActionBar.Solid.Whycheck" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">


    <item name="android:background">@drawable/ab_solid_whycheck</item>


    <item name="background">@drawable/ab_solid_whycheck</item>



    <item name="android:backgroundStacked">@drawable/ab_stacked_solid_whycheck</item>


    <item name="backgroundStacked">@drawable/ab_stacked_solid_whycheck</item>



    <item name="android:backgroundSplit">@drawable/ab_bottom_solid_whycheck</item>


    <item name="backgroundSplit">@drawable/ab_bottom_solid_whycheck</item>



    <item name="android:progressBarStyle">@style/ProgressBar.Whycheck</item>


    <item name="progressBarStyle">@style/ProgressBar.Whycheck</item>


</style>



<style name="ActionBar.Transparent.Whycheck" parent="@style/Widget.AppCompat.ActionBar">


    <item name="background">@drawable/ab_transparent_whycheck</item>


    <item name="android:background">@drawable/ab_transparent_whycheck</item>



    <item name="progressBarStyle">@style/ProgressBar.Whycheck</item>


    <item name="android:progressBarStyle">@style/ProgressBar.Whycheck</item>


</style>



<style name="PopupMenu.Whycheck" parent="@style/Widget.AppCompat.PopupMenu">    


    <item name="android:popupBackground">@drawable/menu_dropdown_panel_whycheck</item>  


</style>



<style name="DropDownListView.Whycheck" parent="@style/Widget.AppCompat.ListView.DropDown">


    <item name="android:listSelector">@drawable/selectable_background_whycheck</item>


</style>



<style name="ActionBarTabStyle.Whycheck" parent="@style/Widget.AppCompat.ActionBar.TabView">


    <item name="android:background">@drawable/tab_indicator_ab_whycheck</item>


</style>



<style name="DropDownNav.Whycheck" parent="@style/Widget.AppCompat.Spinner.DropDown.ActionBar">


    <item name="android:background">@drawable/spinner_background_ab_whycheck</item>


    <item name="android:popupBackground">@drawable/menu_dropdown_panel_whycheck</item>


    <item name="android:dropDownSelector">@drawable/selectable_background_whycheck</item>


</style>



<style name="ProgressBar.Whycheck" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">


    <item name="android:progressDrawable">@drawable/progress_horizontal_whycheck</item>


</style>



<style name="ActionButton.CloseMode.Whycheck" parent="@style/Widget.AppCompat.ActionButton.CloseMode">


    <item name="android:background">@drawable/btn_cab_done_whycheck</item>


</style>



<!-- this style is only referenced in a Light.DarkActionBar based theme -->


<style name="Theme.Whycheck.Widget" parent="@style/Theme.AppCompat">


    <item name="popupMenuStyle">@style/PopupMenu.Whycheck</item>


    <item name="android:popupMenuStyle">@style/PopupMenu.Whycheck</item>



    <item name="dropDownListViewStyle">@style/DropDownListView.Whycheck</item>


    <item name="android:dropDownListViewStyle">@style/DropDownListView.Whycheck</item>


</style>





Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs