Objective
Welcome everyone I share and recommend useful code Snippets ~ ~
Statement
Welcome reprint, but please keep the original source of the article:
CSDN:http://www.csdn.net
rainy season o mo away:http://blog.csdn.net/luckkof
Body
<?xml version= "1.0" encoding= "Utf-8"?> <!--a geometry defined in the shape drawable XML file, defined in the res/drawable/directory, file name filename The resource ID called access is accessed through R.drawable.filename in the code and accessed through @[package:]drawable/filename in the XML file. -<!--android:shape=["Rectangle" | "Oval" | "Line" | The shape of the ring shape, which defaults to a rectangle, can be set to a rectangle (rectangle), oval (oval), linear shape (line), ring, and the following properties are available only at android:shape= "Ring: Android: Innerradius size, radius of inner ring. Android:innerradiusratio float, which represents the radius of the inner ring at the width ratio of the ring, for example, if android:innerradiusratio, which means that the inner ring radius is equal to the width of the ring divided by 5, the value can be overwritten, and the default is 9. Android:thickness size, the thickness of the ring android:thicknessratio float type, the width ratio of the ring to represent the thickness of the ring, for example, if android:thicknessratio= "2", Then the thickness of the ring is equal to the width of the ring divided by 2. This value can be overridden by android:thickness, and the default value is 3. The Android:uselevel Boolean value, or False if it is used as a levellistdrawable using the value of true. --<shape xmlns:android= "http://schemas.android.com/apk/res/android" android:shape= "Rectangle" > <!--rounded corners Android:radius Integer radius android:topleftradius integer upper-left corner radius Android:toprightradius integer right corner radius android Oid:bottomleftradius integer lower-left corner radius Android:bottomrightradius integer right corner Radius--<corners a ndroid:radius= "8DP" android:topleftradius= "5DP" android:toprightradius= "15DP" Android:bottomlef tradius= "20DP" android:bottomrightradius= "25DP"/> <!--gradient Andro Id:startcolor color value start color Android:endcolor color value End Color Android:centercolor integer gradient middle color, that is, the color between the start and end colors Android:angle integral type Gradient Angle (PS: When angle=0, the gradient is left-to-right. Then turn counterclockwise, when angle=90 is from bottom to top. Angle must be an integer multiple of 45) Android:type ["Linear" | "Radial" | "Sweep"] Gradient type (value: Linear, radial, sweep) linear linear gradient, which is the default setting radial Radioactive gradients,Centered on the start color. Sweep the gradient of the scanned line type. Android:uselevel ["True" | FALSE] set to TRUE if you want to use the Levellistdrawable object. Set to True no gradient. False has a gradient Android:gradientradius integral gradient radius. Used when android:type= "radial". Using android:type= "Radial" alone will cause an error. Android:centerx the relative position of the X-point coordinate of the integral Gradient center Android:centery integral type The relative position of the Y-point coordinates of the gradient center--<gradient android:startcolor= "#FFFF0000" android:endcolor= "#80FF 00FF "android:angle="/> <!--padding, that is, the distance between the content and the edge android:left the whole Type left inner margin android:top integer top padding android:right integral right inner margin android:bottom integral bottom padding-- <padding android:left= "10DP" android:top= "10DP" android:right= "10DP" Andro id:bottom= "10DP"/> <!--size AndroId:width integer width android:height integer height-<size android:width= "600DP"/> <!--inner fill Android:color color value fill-<solid android:color= "#ffff 9d77 "/> <!--stroke width of android:width strokes Android:color Yan Color Android:dashwidth integer indicates that the style of the stroke is the width of the dashed line, and the value is 0 o'clock, which is expressed as solid. A value greater than 0 is a dashed line. Android:dashgap integer indicates that a stroke is a dashed line, the interval between dashes is "----"--"--<stroke android:width=" 2DP " Android:color= "#dcdcdc"/> </shape>