Android uses XML to define borders,

Source: Internet
Author: User

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,

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.