Issue
How to change corner radius of android material button. I tried setting corner radius but its not working.
<com.google.android.material.button.MaterialButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@color/colorPrimary"
android:text="Start"
android:textColor="@android:color/white"
android:textSize="18sp"
app:cornerRadius="8dp" />
Solution
you need to set the style
of Button like below
and to use Material Design you need to add below dependencies
in gradle
.
dependencies { implementation ‘com.google.android.material:material:1.1.0’ }
XML
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button"
app:cornerRadius="8dp"/>
Answered By - Mehul Kabaria
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.