如何更改XML主题中操作栏图标或徽标的填充或边距?

Sha*_*hye 5 android android-actionbar

如何使用XML主题更改操作栏图标或徽标空间的顶部和底部填充或边距?

<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>
Run Code Online (Sandbox Code Playgroud)

提供我的风格.

Rav*_*avi 0

使用操作栏的自定义视图并使用 actionBar.setCustomView(View) 设置视图并设置 actionBar.setDisplayShowCustomEnabled(true) 。请参阅链接ActionBar - 自定义视图,ImageView 居中,Action Items 位于两侧