Android UI (i) Layout background local shape fillet design

Source: Internet
Author: User

Jeff Lee blog:http://www.cnblogs.com/alandre/(Mud brick Carpenter), retain the URL when reproduced! Thanks

Today we come to Android UI first: Implement layout background local shape fillet design

:

First step: Define a shape

Res/drawable/shape_to_corner_no_bottom_line.xml

<?xml version= "1.0" encoding= "Utf-8"? ><layer-list xmlns:android= "http://schemas.android.com/apk/res/ Android >    <item>        <!--shape with Circle-top corner--        <shape>            <!--the shape Background color-to            <solid android:color= "@color/black"/>            <corners android:topleftradius= " 10DP "android:toprightradius=" 10DP "                 android:bottomleftradius=" 0.1DP "android:bottomrightradius=" 0.1DP "/>            <stroke  android:width= "1DP" android:color= "@color/black"/>        </shape>    </item> </layer-list>

Where the parameter means: {The English word is the name}

This is a detailed argument<!--rounded Corners-<Corners Android:radius= "9DP"Android:topleftradius= "2DP"Android:toprightradius= "2DP"Android:bottomleftradius= "2DP"Android:bottomrightradius= "2DP"/><!--Set the fillet radius-<!--gradient-<Gradient Android:startcolor= "@android: Color/white"Android:centercolor= "@android: Color/black"Android:endcolor= "@android: Color/black"Android:uselevel= "true"Android:angle= "45"Android:type= "Radial"Android:centerx= "0"Android:centery= "0"Android:gradientradius= "/>" <!--interval--<padding Android:left= "2DP"Android:top= "2DP"Android:right= "2DP"Android:bottom= "2DP"/><!--All directions--<!--size--<size Android:width= "50DP"Android:height= "50DP"/><!--width and height--<!--filled-in <Solid Android:color= "@android: color/white"/><!--filled colors-<!--strokes-<Stroke Android:width= "2DP"Android:color= "@android: Color/black"Android:dashwidth= "1DP"Android:dashgap= "2DP"/>Fill: Sets the color interval for the fill: sets the interval size in four directions: Set the size fillet: Set five properties at the same time, the Radius attribute is invalid Android:radius= "20DP"set the radius of the Four Corners Android:topleftradius= "20DP"sets the radius of the upper-left corner Android:toprightradius= "20DP"set the RADIUS android:bottomleftradius in the upper-right corner= "20DP"set the RADIUS android:bottomrightradius in the lower right corner= "20DP"set the radius stroke in the lower-left corner: The Dashwidth and Dashgap properties, as long as one is set to 0DP, the border is the implementation border Android:width= "20DP"sets the width of the edge Android:color= "@android: Color/black"sets the color of the edge android:dashwidth= "2DP"sets the width of the dashed line Android:dashgap= "20DP" Sets the interval width of the dashed line

Gradient: No gradient effect when the fill color is set. The value of the angle must be a multiple of 45 (including 0), only valid in type= "linear", or it will be an error. Android:uselevel This attribute does not know what is the use.

Step two: Setup in Layout
   android:background= "@drawable/shape_to_corner_no_bottom_line"

So it's easy to set up.

Android UI (i) Layout background local shape fillet design

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.