I want to make the corners of a button
round. Is there an easy way to achieve this in Android?
drawable folder
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFF"/>
<corners android:radius="30dp"/>
<stroke android:width="2dp" android:color="#999999"/>
</shape>
layout folder
<Button
android:id="@+id/button2"
<!-- add style to avoid square background -->
style="@style/Widget.AppCompat.Button.Borderless"
android:background="@drawable/corner_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
make sure add style to avoid square background