1create shape.xml in drawable folder
2
3like shape.xml
4
5<?xml version="1.0" encoding="utf-8"?>
6<shape xmlns:android="http://schemas.android.com/apk/res/android" >
7 <stroke android:width="2dp"
8 android:color="#FFFFFF"/>
9 <gradient
10 android:angle="225"
11 android:startColor="#DD2ECCFA"
12 android:endColor="#DD000000"/>
13<corners
14 android:bottomLeftRadius="7dp"
15 android:bottomRightRadius="7dp"
16 android:topLeftRadius="7dp"
17 android:topRightRadius="7dp" />
18</shape>
19and in myactivity.xml
20
21you can use
22
23<Button
24 android:id="@+id/btn_Shap"
25 android:layout_width="wrap_content"
26 android:layout_height="wrap_content"
27 android:text="@string/Shape"
28 android:background="@drawable/shape"/>