8. Android implements a function similar to a Shape that only requires a certain border ., 8. androidshape

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.