The code has a detailed explanation, there is not much to say, in the use of the direct set to background on the line
<?xml version= "1.0" encoding= "utf-8"?><!--Purpose: To give a layout up and down a border, no border around--><layer-list xmlns:android= "http:/ /schemas.android.com/apk/res/android > <!--First define a color that fills the content area, because this color is obscured by the color of the next content area, so the first defined color is the color of the border- <item> <shape android:shape= "Rectangle" > <solid android:color= "#000000"/> </shape> </item> <!-- then define a color for the fill area and set the inner margin for the color to cover the background without obscuring the whole purpose . android:top= "1DP" android:bottom= "1DP" These two are defined below the thickness of the top and bottom border of the pading just defined the bottom spacing, optional--and <item android:bottom= "1DP" android:top= "1DP" > <shape android:shape= "Rectangle" > < Solid android:color= "#ffffff"/> <padding android:bottom= "4DP" android:left= "4DP" android:right= "4DP" android:top= "4DP"/> </shape> </item></layer-list>
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android implements a layout or view with a top border or a border with a border or a single border