[Android] Different between Padding and Margin in Layout
2011-05-04 14:17
621 查看
The original descriptions in Android
* Padding
The padding is expressed in pixels for the left, top, right and bottom parts of the view. Padding can be used to offset the content of the view by a specific amount of pixels.
* Margin
Specifies extra space on the bottom side of this view. This space is outside this view's bounds.
In brief speaking,
* A Padding is used inside of the View to shift contents in it.
* A Margin is used outside of the View for a ViewGroup to layout the empty space at the side of child
PS.
1. To measure its dimensions, a view takes into account its padding.
2. Even though a view can define a padding, it does not provide any support for margins. However, view groups provide such a support.
* Padding
The padding is expressed in pixels for the left, top, right and bottom parts of the view. Padding can be used to offset the content of the view by a specific amount of pixels.
* Margin
Specifies extra space on the bottom side of this view. This space is outside this view's bounds.
In brief speaking,
* A Padding is used inside of the View to shift contents in it.
* A Margin is used outside of the View for a ViewGroup to layout the empty space at the side of child
PS.
1. To measure its dimensions, a view takes into account its padding.
2. Even though a view can define a padding, it does not provide any support for margins. However, view groups provide such a support.
相关文章推荐
- android:padding和android:layout_margin的区别
- android:paddingLeft和android:layout_marginLeft的区别
- android:padding和android:layout_margin的区别?
- android:layout_marginStart和android:paddingStart的区别
- android paddingLeft 和 layout_marginLeft的区别
- android:padding和android:layout_margin的区别
- Android中的layout_margin和padding
- android:gravity / android:layout_Gravity,android:padding / android:layout_margin属性区分
- android:padding和android:layout_margin的区别
- android:padding与android:layout_margin;gravity与layout_gravity
- android之android:paddingLeft和android:layout_marginLeft区别:
- Difference between px, dp, dip and sp in Android?
- android:layout_paddingLeft和android:layout_marginLeft区别
- android:padding和android:layout_margin的区别?
- Android android:paddingLeft与android:layout_marginLeft的区别
- Difference Between Thread and AsyncTask in Android
- Android中gravity、layout_gravity、padding、margin的区别小结
- Android中padding与layout_margin的区别与用法
- what is the different between function and method in python
- the different between "in" and "exist "