Android shape summary and control style customization

1: shape summary 

1): The shape file is placed under the drawable file. res/drawable/filename.xml.
 
2) :shape type: android :shape. There are four kinds: rectangle, oval, line, ring.
 
3) :corners tag: Define rounded corners. It works if and only if the control type is rectangle. android :radiuse The radius of the rounded corners. Of course, it can also be set individually for each rounded corner.
 
4): gradient tag: color gradient.
 
android :angle: The direction of the color gradient. 0 is from left to right; 90 degrees is from bottom to top. angle must be guaranteed to be a multiple of 45.
 
 
android :startColor, android :centerColor, android :endColor: respectively the start color, middle color and end color of the color. If no intermediate color is set, then gradient from the starting color to the ending color, otherwise it will gradient from the starting color to the intermediate color, and then gradient from the intermediate color to the ending color.
 
 
android :centerX, android :centerY: I think the premise of the existence of these two attributes is necessary
 
android :centerColor. The reason is that when I don't set the android :centerColor property, any changes to the values ​​of these two properties will not change the display effect of the control. These two properties are the middle of the gradient. The size is 0.0--1.0 again.
android : gradient Radius
 The size of the radius of the gradient. Only works when the gradient type is radial.
 
 
android :type
 The type of gradient. There are three cases: linear, radial, sweep.
 
 
5):solid tag:
 The color fill of the control.
 
 
6): stroke label: the line of the shape.
 
 
android :width: The width of the line.
android :color: The color of the line.
 
 
android :dashWidth: The length of the line. When this value is set, a dashed line will be displayed. Unless you set the value of dashWidth to a large value, it still looks like a complete line.
 
 
android :dashGap: The distance between lines. Only works if the dashWidth property is set. Think of it as the width between the dotted lines.
 
 
7):padding label: padding. The distance between the content of the control and the four sides of the control. It's a little weird here. After writing the control style customization, let's talk about it

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325846846&siteId=291194637