Explanation in Google's Android document:
Public static final int padding since: API Level 1
Sets the padding, in pixels, of all four edges. padding is defined as space between the edges of the view and the view's content. A views size will include it's padding. ifbackgroundIs provided, the padding will initially be set to that (0 if the drawable does not have padding). explicitly setting a padding value will override the corresponding padding found in the background.
Must be a dimension value, which is a floating point number appended with a unit such"14.5sp". Available units are: Px (pixels), DP (density-independent pixels), SP (scaled pixels Based on preferred font size), in (INCHES), mm (millimeters ).
This may also be a reference to a resource (in the form"@[package:]type:name") Or theme attribute (in the form"?[package:][type:]name") Containing a value of this type.
Constant Value: 16842965 (0x010100d5) and then look at margin. Take marginbottom as an example: Android: layout_marginbottom since: API level
Specifies extra space on the bottom side of this view. This space is outside this view's bounds.
Must be a dimension value, which is a floating point number appended with a unit such"14.5sp". Available units are: Px (pixels), DP (density-independent pixels), SP (scaled pixels Based on preferred font size), in (INCHES), mm (millimeters ).
This may also be a reference to a resource (in the form"@[package:]type:name") Or theme attribute (in the form"?[package:][type:]name") Containing a value of this type.
This corresponds to the global attribute resource symbollayout_marginBottom.
Related Methods
- Setmargins (INT, Int, Int, INT)
Therefore, padding defines the distance between the content of the control and the edge of the Control. Padding indicates the padding, while margin indicates the distance between the four edges of the control, it refers to the distance from other controls. margin has edges and the page is white.
Use a picture of someone else to illustrate