btn_red.xml
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
item
android:state_pressed
=
"true"
>
<
shape
>
<
solid
android:color
=
"#ef4444"
/>
<
stroke
android:width
=
"1dp"
android:color
=
"#992f2f"
/>
<
corners
android:radius
=
"3dp"
/>
<
padding
android:left
=
"10dp"
android:top
=
"10dp"
android:right
=
"10dp"
android:bottom
=
"10dp"
/>
</
shape
>
</
item
>
<
item
>
<
shape
>
<
gradient
android:startColor
=
"#ef4444"
android:endColor
=
"#992f2f"
android:angle
=
"270"
/>
<
stroke
android:width
=
"1dp"
android:color
=
"#992f2f"
/>
<
corners
android:radius
=
"3dp"
/>
<
padding
android:left
=
"10dp"
android:top
=
"10dp"
android:right
=
"10dp"
android:bottom
=
"10dp"
/>
</
shape
>
</
item
>
</
selector
>
layout.xml
<
Button
android:text
=
"Button"
android:id
=
"@+id/button1"
android:background
=
"@drawable/btn_red"
></
Button
>
참조 : http://www.dibbus.com/2011/02/gradient-buttons-for-android/