vendredi 6 février 2015

Is there any way to center an image in a button using just the XML in 4.2.2? [on hold]


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>
</style>


The button should be exactly 90dp × 90dp, but I don't know how the 48px × 48px image translates into dp.





Aucun commentaire:

Enregistrer un commentaire