What is the difference between a View\'s Margin and Padding?
Padding
Padding is inside of a View.For example if you give android:paddingLeft=20dp
, then the items inside the view will arrange with 20dp
width from left.You can also use paddingRight
, paddingBottom
, paddingTop
which are to give padding from right, bottom and top respectively.
Margin
Margin is outside of a View
. For example if you give android:marginLeft=20dp
, then the view will be arranged after 20dp
from left.