Drawable uses shape resources in Android

This article shares the specific content of drawable's use of shape resources for your reference. The specific contents are as follows

1. Draw a dotted line in the horizontal direction

Android: width = "1DP" refers to the height of the line, Android: dashgap = "3DP" refers to the width of the gap between dotted lines, and 0 refers to a solid line; Android: dashwidth = "6dp" indicates the width of each dotted line.

Note: above version 4.0, Android: layertype = "software" needs to be set in the control, otherwise the dotted line is invalid and displayed as a solid line.

2. Draw a vertical dotted line

Or use the following method

3. Draw a solid circle

4. Draw a circle

Android: innerradius = "15dp" set the size, radius of the inner ring Android: thickness = "10dp" set the size, thickness of the ring Android: uselevel = "false" Boolean value, if it is used as levellistdrawable, the value is true, otherwise it is false

Android: innerradiusratio = "9" floating point type: the radius of the inner ring is represented by the width ratio of the ring, which means that the radius of the inner ring is equal to the width of the ring divided by 5. This value can be overridden. The default value is 9. Android: thicknessratio = "2" floating point type: the thickness of the ring is represented by the width ratio of the ring, which means that the thickness of the ring is equal to the width of the ring divided by 2. This value can be overridden by Android: thickness. The default value is 3

5. Draw a rectangle

summary

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>