android - Increase spacing between action buttons? -
this menu.xml
@ moment
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_save" android:title="save" android:icon="@drawable/ic_action_save" app:showasaction="ifroom|withtext" /> <item android:id="@+id/action_delete" android:title="delete this" android:icon="@drawable/ic_action_delete" app:showasaction="never"/> </menu>
however, spacing between overflow menu , main save button pretty small. i'd add more spacing.
here styles.xml
<resources> <style name="mytheme" parent="theme.appcompat.light.darkactionbar"> <!-- ... --> <item name="android:actionbuttonstyle">@style/myactionbuttonstyle</item> </style> <style name="myactionbuttonstyle" parent="widget.appcompat.light.actionbutton"> <item name="android:paddingend">100dip</item> <item name="android:paddingright">100dip</item> <item name="android:layout_marginright">100dip</item> <item name="android:horizontalspacing">100dip</item> </style> <!-- ... --> </resources>
unfortunately, style has no effect.
the thing can work <item name="android:minwidth">300dp</item>
. using now, problem going have various buttons of different widths, better if set spacing or padding instead of min-width.
why of padding rules of 100dip
not working, , should instead?
found solution, added following lines in styles.xml file , worked!!
<style name="apptheme" parent="appbasetheme"> <item name="android:actionbuttonstyle">@style/myactionbuttonstyle</item> </style> <style name="myactionbuttonstyle" parent="appbasetheme"> <item name="android:minwidth">20dip</item> <item name="android:padding">0dip</item> </style>
Comments
Post a Comment