1. Create a new Shape.xml file under the drawable directory in the Res directory
- <? XML version= "1.0" encoding="Utf-8"?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="Rectangle" >
- <!--filled colors--
- <solid android:color="#FF065E8D" />
- <!--set the four corners of the button arc--
- <!--Android:radius arc radius--
- <corners android:radius="15dip" />
- <!--The spacing between the text and the button boundary in the Padding:button
- <padding
- android:bottom="10DP"
- android:left="10DP"
- android:right="10DP"
- android:top="10DP" />
- </shape>
2. Called in the layout file.
- <? XML version= "1.0" encoding="Utf-8"?>
- <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
- <Button
- android:id="@+id/roundbutton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="@drawable/shape"
- android:text="fillet button" />
- </linearlayout>
How Android Sets the Fillet button