<? Xml version = "1.0" encoding = "UTF-8"?>
<Shape xmlns: android = "http://schemas.android.com/apk/res/android"
Android: shape = "rectangle">
<Gradient android: startColor = "#509245" android: centerColor = "#3e8532"
Android: endColor = "#509245" android: type = "linear" android: angle = "90"
Android: centerX = "0.5" android: centerY = "0.5"/>
<Padding android: left = "7dp" android: top = "7dp" android: right = "7dp"
Android: bottom = "7dp"/>
<Corners android: radius = "4dp"/>
</Shape>
Android: shape is configured in the form of a graph, mainly including a square or a circle. The code above is a square.
Gradient nodes are mainly configured with the starting point color, the ending point color, the coordinates of the intermediate points, the color of the intermediate points, and the gradient angle (90 degrees for the upper and lower gradient, 0 for the left and right gradient ), the padding node is mainly configured with the upper and lower margins, and the corners node is configured with the radius of the surrounding corner.