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.
you can try to make a custom view, and specifi the icon margin in it as you want: getActionBar().setCustomView(R.id.your_custom_view);
You can try to create a new style for your icon in action bar like this : *Add this code in your styles.xml
*add your style to the UI action bar .
Also you can see this exemple customizing-action-bar
add this line to your theme
android:theme="@style/MyTheme"
applied underapplication
tag in manifestAnd
in your same style.xml
use your custom view for action bar and set the view using actionBar.setCustomView(View) & also set actionBar.setDisplayShowCustomEnabled(true) . Refer to the link ActionBar - custom view with centered ImageView, Action Items on sides