Android XML Drawing p113-p117

Source: Internet
Author: User

1.Bitmap

<? XML version= "1.0" encoding= "Utf-8" ?> <  xmlns:android= "http://schemas.android.com/apk/res/android"    android:src = "@mipmap/ic_launcher" > </ Bitmap >

2.shape

<?XML version= "1.0" encoding= "Utf-8"?><Shapexmlns:android= "Http://schemas.android.com/apk/res/android"Android:shape= "Rectangle"><!--shape has rectangle (rectangle), oval (oval), line (straight), Ring (ring) -        <!--corners used when shape is rectangle, default is 1DP -    <CornersAndroid:bottomleftradius= "1DP"Android:bottomrightradius= "1DP"Android:radius= "1DP"Android:topleftradius= "1DP"Android:toprightradius= "1DP" />    <!--Gradient Gradient -    <GradientAndroid:angle= "integer"Android:centercolor= "Color"Android:centerx= "integer"Android:centery= "integer"Android:endcolor= "Color"Android:gradientradius= "integer"Android:startcolor= "Color"Android:type= "Linear/radial/sweep"Android:uselevel= "Boolean" />    <paddingAndroid:bottom= "1DP"Android:left= "1DP"Android:right= "1DP"Android:top= "1DP" />    <!--the size is specified in sizes, and is typically used with the ImageView Mate ScaleType Property -    <sizeAndroid:width= "integer"Android:height= "integer"/>    <!--Solid Fill Color -    <SolidAndroid:color= "Color"/>        <!--stroke Specifies border dashwidth: Dashed width dashgap: Dash interval width -    <StrokeAndroid:color= "Color"Android:width= "integer"Android:dashwidth= "integer"Android:dashgap= "integer"        /></Shape> 

3.layer Layer Overlay

<?XML version= "1.0" encoding= "Utf-8"?><layer-listxmlns:android= "Http://schemas.android.com/apk/res/android">    <Itemandroid:drawable= "@mipmap/ic_launcher" />    <ItemAndroid:bottom= "10DP"android:drawable= "@mipmap/ic_launcher"Android:left= "10DP"Android:right= "10DP"Android:top= "10DP" /></layer-list>

4.Selector

<?XML version= "1.0" encoding= "Utf-8"?><selectorxmlns:android= "Http://schemas.android.com/apk/res/android">    <!--background picture by default -    <Itemandroid:drawable= "@mipmap/ic_launcher" />    <!--background picture When there is no focus -    <Itemandroid:drawable= "@mipmap/ic_launcher"android:state_window_focused= "false" />    <!--background image when clicked in non-touch mode -    <Itemandroid:drawable= "@mipmap/ic_launcher"android:state_focused= "true"android:state_pressed= "true" />    <!--background picture when clicked in touch mode -    <Itemandroid:drawable= "@mipmap/ic_launcher"android:state_focused= "false"android:state_pressed= "true" />    <!--background picture When selected -    <Itemandroid:drawable= "@mipmap/ic_launcher"android:state_selected= "true" />    <!--background picture when getting focus -    <Itemandroid:drawable= "@mipmap/ic_launcher"android:state_focused= "true" /></selector>

Usually, it can be combined.

Android XML Drawing p113-p117

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.