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