The following button label is an example:
Here is the link to the label <shape>, set the background style, border, gradient, fillet, etc., the use of various effects see the following code
Drawable folder creates a new Buttonstyle.xml with the following contents
1 <?XML version= "1.0" encoding= "Utf-8"?> 2 <Shapexmlns:android= "Http://schemas.android.com/apk/res/android"> 3 <GradientAndroid:startcolor= "#c0000000"Android:endcolor= "#c0000000"Android:angle= "All" /><!--background color gradient angle to gradient angle - 4 <SolidAndroid:color= "#00ffffff" /><!--Background Fill Color - 5 <StrokeAndroid:width= "3DP"Android:color= "#ff000000" /><!--stroke, Border width, color - 6 <CornersAndroid:radius= "10DP" /><!--radius of Corner arc - 7 <paddingAndroid:left= "3DP"Android:top= "3DP"Android:right= "3DP"Android:bottom= "3DP" /><!--A blank space left around - 8 </Shape>
Then, in the button, refer to the following:
< Button Android:id = "@+id/button" android:layout_width= "Wrap_content" android:layout_height= "Wrap_ Content " android:text=" button " android:background=" @drawable /buttonstyle "/>
Reference: http://blog.csdn.net/mj19910923/article/details/8633255
Android Button Set Border instance