What is the difference between a View\'s Margin and Padding?
In addition to all the correct answers above, one other difference is that padding increases the clickable area of a view, whereas margins do not. This is useful if you have a smallish clickable image but want to make the click handler forgiving.
For eg, see this image of my layout with an ImageView
(the Android icon) where I set the paddingBotton
to be 100dp
(the image is the stock launcher mipmap ic_launcher
). With the attached click handler I was able to click way outside and below the image and still register a click.