Home  >  Article  >  Backend Development  >  xml template, custom button background

xml template, custom button background

黄舟
黄舟Original
2017-03-18 16:33:021749browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn