Shape is used to set shapes, can be used in selector,layout, and so on, with 6 child tags, each with the following properties:
<?xml version= "1.0" encoding= "Utf-8"?> <shape xmlns:android= "Http://schemas.android.com/apk/res/android" > <!--rounded corner--> <corners android:radius= "9DP" android:topleftradius= "2DP" Android:toprightrad ius= "2DP" android:bottomleftradius= "2DP" android:bottomrightradius= "2DP"/><!--set Fillet radius--> <!--gradient --> <gradient android:startcolor= "@android: Color/white" android:centercolor= "@android: Color/black" an Droid:endcolor= "@android: Color/black" android:uselevel= "true" android:angle= "android:type=" and "radial" roid:centerx= "0" android:centery= "0" android:gradientradius= "/> <!--interval--> <padding and roid:left= "2DP" android:top= "2DP" android:right= "2DP" android:bottom= "2DP"/><!--each direction interval--> < !--size--> <size android:width= "50DP" android:height= "50DP"/><!--width and height--> <!--fill
; <solid Android:coloR= "@android: Color/white"/><!--fill Color--> <!--stroke--> <stroke android:width= "2DP" Android:
Color= "@android: Color/black" android:dashwidth= "1DP" android:dashgap= "2DP"/> </shape>
Fills: Setting the color of a fill
Interval: Sets the interval in four directions
Size: Setting size
Rounded Corner: The Radius property is not valid if five properties are set at the same time
- android:radius= "20DP" sets the radius of Four Corners
- android:topleftradius= "20DP" sets the radius of the upper-left corner
- android:toprightradius= "20DP" sets the radius of the upper right corner
- android:bottomleftradius= "20DP" sets the radius of the lower right corner
- android:bottomrightradius= "20DP" sets the radius of the lower-left corner
Strokes: Dashwidth and Dashgap properties, as long as one of them is set to 0DP, the border is the implementation border
- Android:width= "20DP" sets the width of the edges
- Android:color= "@android: Color/black" Sets the color of the edges
- Android:dashwidth= "2DP" sets the width of the dashed line
- android:dashgap= "20DP" sets the interval width of dashes
Gradient: No gradient effect after setting the fill color. 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 property does not know what is the use.
Angle the starting point of the corresponding value is shown in figure:
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.