Distance unit and internal and external margins, distance unit margin
Commonly used Distance Units in android development include px, dp, and sp.
Px is a pixel. For example, on a 480*800 resolution display screen, there are 480 small grids on the horizontal bar, and 800 small grids on the vertical bar. Each grid represents a pixel. The higher the Resolution, the more pixels, the more content displayed.
The screen size is the same, but the resolution may be different, so dpi may be different, and the level of detail will be different.
Dp = dip (Device Independent pixels)
Px = dp * (dpi/160)
On a screen with dpi 160: 1dp = 1px
Sp: scaled pixels, which is usually used to specify the font size. When a user modifies the font displayed on the mobile phone, the sp changes accordingly.
The padding and padding are used to control the display style of the control.
Set the padding and padding