Android Learning Essay UI beautification (ii)---------shape use

Source: Internet
Author: User

Shape is used for setting shapes, can be used in selector,layout, etc., with 6 sub-labels.

Sizes (size)

Gradient (gradient)

Fill (solid)

Rounded corners (corners)

Stroke (stroke)

Interval (padding)

Res/drawable/shape_self.xml

<?XML version= "1.0" encoding= "Utf-8"?><Shapexmlns:android= "Http://schemas.android.com/apk/res/android" >    <!--height of the interior picture of the control -    <sizeAndroid:height= "100DP"Android:width= "180DP" />    <!--gradient (gradient) -    <GradientAndroid:centercolor= "@color/gray"Android:endcolor= "@color/darkcyan"Android:startcolor= "@color/orangered" />    <!--Solid (Solid) experiment results: If you specify both the solid and gradient properties, the color that solid points to will replace the color that the gradient points to -    <!--<solid android:color= "@color/mediumorchid"/> -    <!--Stroke (stroke) -    <StrokeAndroid:width= "5DP"Android:color= "@color/gold" />    <!--Corners (Fillet) control radius of Four Corners -    <!--set Four corner fillet radius <corners android:bottomleftradius= "20sp" android:bottomrightradius= "20SP" respectively android:topleftradius= "20SP" android:toprightradius= "20sp"/> -    <!--the above notation is equivalent to (here is a uniform set of Four corners) -    <CornersAndroid:radius= "20SP" />    <!--pading (interval), the length of the content in the control from four edges -    <paddingAndroid:bottom= "4DP"Android:left= "55DP"Android:right= "5DP"Android:top= "35DP" /></Shape>

Implementation results:

Android Learning Essay UI beautification (ii)---------shape use

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.