Button wrapping content wrongly with drawable inside

While using an android button, I keep coming back to the same problem… When I try to add a drawable to a button, the button keeps wrongly framing the drawable.

The button code:

<Button
        android:id="@+id/cancel_directions_button_v2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:drawableBottom="@drawable/i_close"
        app:layout_constraintStart_toEndOf="@id/info_directions_textview"
        app:layout_constraintBottom_toBottomOf="parent"
        android:backgroundTint="@color/colorPrimary"
        android:layout_marginBottom="26sp"
        android:visibility="gone"
        />

Photo:
enter image description here

Source: Android Questions

LEAVE A COMMENT