The following is the right border of the set button and the color of the bottom border is red and the frame size is 3DP, such as:
Create a new Btnstyle.xml file in drawable with the following contents:
<?XML version= "1.0" encoding= "Utf-8"?><layer-listxmlns:android= "Http://schemas.android.com/apk/res/android" > <!--Hyphen Color Value - <Item> <Shape> <SolidAndroid:color= "#ff0000"/><!--Border Red - </Shape> </Item> <!--body Background color value - <ItemAndroid:bottom= "3DP"Android:right= "3DP"><!--set up to draw several sides - <Shape> <SolidAndroid:color= "#009900"/><!--main body Green - <paddingAndroid:bottom= "10DP"Android:left= "10DP"Android:right= "10DP"Android:top= "10DP" /> </Shape> </Item></layer-list>
Reference
android:background= "@drawable/btnstyle"
<?XML version= "1.0" encoding= "Utf-8"?><Relativelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical" > <ButtonAndroid:id= "@+id/button1"android:layout_centerinparent= "true"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:background= "@drawable/btnstyle"Android:text= "button" /></Relativelayout>
Android uses solid to define colors for different borders, and you can define only one border color