LoginSignup
4
4

More than 5 years have passed since last update.

[Android] Button Corner Radius

Posted at

If you want to make some button with corner radius like this:

Screen Shot 2014-12-19 at 23.09.47.png

1.Create a drawable xml file.

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="#FF5E3A"/>
            <corners android:radius="10dp"/>
        </shape>
    </item>
</selector>

2.Set this drawable as your button's background.

<Button
    android:text="CLICK"
    android:background="@drawable/orange_corner_radius_bg"
    android:textColor="#ffffff"
    android:layout_width="match_parent"
    android:layout_height="40dp" />
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4