xml template, custom button background
<?xml version="1.0" encoding="utf-8"?> <corners android:bottomleftradius="4dp" android:bottomRightRadius="4dp" android:topLeftRadius="4dp" android:topRightRadius="4dp"/> <padding android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp"/> <corners android:bottomleftradius="4dp" android:bottomRightRadius="4dp" android:topLeftRadius="4dp" android:topRightRadius="4dp"/> <padding android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp"/>
The outermost layer is the selector, which contains the state_pressed attribute of the two items that will be triggered when it is clicked. True means that it is clicked. Item, false is the default value, which contains items that have not been clicked. The shape attribute can control the displayed shape. Generally, rectangle or oval is selected. If you want it to be circular, you need to limit the height to be equal to the width and greater than the width of the text. Line, add
<size android:width="130dp" android:height="130dp" />
to the node, which contains very rich content
Fill color
Edge width: Edge width color: Color dashWidth: Dash width, dashGap: The dotted line interval width is rounded, and four corners can be set. At this time, the shape is a rectangle, or the radius can be set at one time
Set the width and height
Set the inner margin
The above is the detailed content of xml template, custom button background. For more information, please follow other related articles on the PHP Chinese website!