8. Android implements a function similar to a Shape that only requires a certain border ., 8. androidshape
<? Xml version = "1.0" encoding = "UTF-8"?> <Layer-list xmlns: android = "http://schemas.android.com/apk/res/android"> <item> <shape android: shape = "rectangle"> <solid android: color = "@ android: color/transparent "/> <stroke android: width =" 1dp "android: color =" # ff12d8c9 "/> </shape> </item> <item android: bottom = "1dp" android: top = "1dp"> <shape android: shape = "rectangle"> <solid android: color = "# ffffffff"/> </shape> </item> </layer-list>
For example, you can use layer-list to set the border color on the first layer. The second layer can be used to hide the section that does not belong to the border on the first layer. For example, the second layer hides the 1dp height color at the top and bottom of the first layer, and the effect is to implement the top and bottom borders.