Maybe it's a simple situation, but I've already broken my head here and still have not succeeded.
I have a button, and inside it I load an image and a text.
<Button
android:id="@+id/btNovaPreVenda"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="16dp"
android:background="@drawable/shape"
android:drawableLeft="@drawable/carrinhodecompras"
android:paddingTop="1sp"
android:text=" | Nova Pré-Venda"
android:textColor="@color/branco" />
However, because layout_width is set to fill_parent
, the image is left and text is centered.
However, if I put the layout_width as wrap_content, it works because the button will be created as needed.
Any idea how to leave layout_width
as fill_parent
and the image be centered with the text?
Currently, this is . I would like to like