I am trying to display a normal icon on before the text on the button. I know how it should work and I don't know why it doesn't.
Things I have already tried:
Here is the code I use:
<Button
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_check_black_24dp"
android:text="Button with Left Icon" />
Any tips on what I could try or how I could make a button with icon differently?
Try like this
<com.google.android.material.button.MaterialButton
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TEXT"
style="@style/Widget.AppCompat.Button.Borderless"
app:icon="@drawable/ic_refresh_black_24dp"
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With