Only up and down borders colored
layer-list Item Inner Rectangle shape overlay implementation
XML Drawing Background Layout_line.xml
<?XML version= "1.0" encoding= "Utf-8"?><layer-listxmlns:android= "Http://schemas.android.com/apk/res/android"> <!--Hyphen Color Value - <Item> <Shape> <SolidAndroid:color= "#CCCCCC" /> </Shape> </Item> <!--body Background color value - <!--It is defined here that only the upper and lower sides have a border height of 1 pixels - <ItemAndroid:bottom= "1DP"Android:top= "1DP"> <!--white background color inside border - <Shape> <SolidAndroid:color= "#ffffff" /> </Shape> </Item></layer-list>
Set to control
< LinearLayout Android:layout_width = "Match_parent" android:layout_height= "Wrap_content" android:layout_margintop = "8DP" android:background= "@drawable/layout_line" Android:o Rientation= "Horizontal">
:
If necessary, modify:
android:top= "1DP" android:left= "1DP" android:right= "1DP" android:bottom= "1DP"
Display the desired border
Android uses XML to define borders,