I am doing in this way
<com.google.android.material.button.MaterialButton
android:id="@+id/btnProceed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Proceed to enter Gender"
style="@style/bottomBtnStyle"
app:icon="@drawable/ic_right_arrow"
app:iconGravity="textStart"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"/>
But icon is getting displayed on left side of text, icon gravity has no effect on icon position. In normal Buttons we used to achieve same with drawableRight, but here not finding a way.
app:icon="@drawable/ic_right_arrow"
is fine if you need to show in left. And for to show right you need to add app:iconGravity="end" too.
And make sure you are using correct style for button. It means parent of bottomBtnStyle must be Widget.MaterialComponents.Button
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