I've got a great image of a right arrow and a button to put it in, but I definitely don't want it flush to a side. Is there any way to put it in the center using only the XML?
Here's the relevant code:
<style name="widget.numberPad.actionButton.done.small" parent="widget.numberPad.actionButton.done">
<item name="android:layout_width">90dp</item>
<item name="android:drawableStart">@drawable/ic_arrow_forward_white_48px</item>
<item name="android:gravity">center_horizontal|center_vertical</item>
<item name="android:layout_alignParentBottom">true</item>
<item name="android:layout_centerHorizontal">true</item>
</style>
The button should be exactly 90dp × 90dp
, but I don't know how the 48px × 48px
image translates into dp
.
I've read How to center icon and text in a android button with width set to “fill parent”, but the solution is both in java and deals with a width issue that I do not.