Basic use of shape in Android
Shape is used to set the shape. It can be used in selector, layout, etc. If you click the effect, you don't need to cut the UI. You can use shape directly, which is convenient and quick. A new shape. xml is a rectangle by default. You can use android: shape = to set a specific shape. There are four types: rectangle, oval elliptical shape, line, and ring. Shape has six sub-labels, each of which has the following attributes:
Fill: Set the fill color
Interval: Set the interval in four directions.
Size: set the size.
Rounded corner: if five attributes are set at the same time, the Radius attribute is invalid.
Android: Radius = 20dp set the Radius of the four corners
Android: topLeftRadius = 20dp: Set the radius in the upper left corner.
Android: topRightRadius = 20dp set the radius in the upper right corner
Android: bottomLeftRadius = 20dp
Android: bottomRightRadius = 20dp: Set the radius in the lower left corner.
Stroke: The dashWidth and dashGap attributes. If one of them is set to 0dp, the border is the implemented border.
Android: width = 20dp set the Edge width
Android: color = @ android: color/black sets the edge color
Android: dashWidth = 2dp set the width of the dotted line
Android: dashGap = 20dp set the interval width of the dotted line
Gradient: No gradient effect after the fill color is set. The angle value must be a multiple of 45 (including 0). It is valid only when type = linear. Otherwise, an error is returned. Android: useLevel.