Create an XML file in the drawable Folder:
- <? XML version = "1.0" encoding = "UTF-8"?>
- <Shape xmlns: Android = "http://schemas.android.com/apk/res/android"
- Android: Shape = "rectangle">
- <Gradient
- Android: startcolor = "#00000000"
- Android: centercolor = "# ffffffff"
- Android: endcolor = "#00000000"
- Android: angle = "0"/>
- </Shape>
ShapeNodes are configured in the form of graphs, including squares and circles.CodeSquare,
GradientNodeIt mainly configures the color of the starting point, the ending point, the color of the intermediate point, the coordinates, and the gradient effect (Angle)(0, 90, 180SlaveLeft to rightGradient,270SlaveTop to bottomGradient) from left to right by default
PaddingNodes are mainly configured with the spacing between top, bottom, and left.
Corners Configure the radius of the surrounding garden feet on the node
Finally, you need to use the XML file to call it: Android: backgroud = "drawable/Name of your file"