/** * Crazyandcoder * Contact: * QQ : 275137657 * Email: [Email protected] * Reprint please indicate the source!
Android Shape Usage Summary
Shape means shapes, and shape in Android can define the shape and style of the control. The specific usage is to create a new. xml file under Res/drawable and then set the style of the control. Let's start by looking at the properties that shape contains:
Corners represents a fillet, what does it mean? That is, sometimes we have to set the rounded shape around the control, so we can set this property value. It has five sub-attribute values, which represent the rounded radius of the whole, and the radius of the rounded corners that have been four weeks. However, it is important to note that if the five attribute values are set, then the "Android:radius" property value will not work.
gradient represents the meaning of the gradient, that is, for its color has a gradient style, we still have to use examples to specify the better.
- StartColor: The color at which the gradient starts
- EndColor: Color at end of gradient
- Angle: The angle of the gradient, the value is a multiple of 45°, 0 is a left-to-right gradient, 90 is the bottom-up gradient, and the counter-clockwise gradient.
- Type: Types of gradients, default linear, specifying a gradient radius when selected as radial Gradientradius
type= "radial " type= "linear"
a color fill that represents the color that the control is overwritten with. Only one property value: Android:color= "#42fd45"
What do you mean by strokes? Even if the edge of the control is drawn.
- Width: thickness of the control stroke
- Color: Colors after a control stroke
- Dashwidth: Indicates the width of "-"
- Dashgap: Represents the distance between two "-", if set 3, 42 attributes is a dashed line, not set is the solid lines.
3, 4 property not set 3, 4 property
These are the main properties of shape, and by setting these property values, we can draw the effect we want, what good is this? It is not necessary to use the image to fix the style of the control, which will reduce the size of the APK package. If we make good use of it, we can draw the effect we want.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android Shape Usage Summary