Difference between a View's Padding and Margin

后端 未结 14 3122
渐次进展
渐次进展 2020-11-22 06:45

What is the difference between a View\'s Margin and Padding?

14条回答
  •  一个人的身影
    2020-11-22 07:03

    Let's just suppose you have a button in a view and the size of the view is 200 by 200, and the size of the button is 50 by 50, and the button title is HT. Now the difference between margin and padding is, you can set the margin of the button in the view, for example 20 from the left, 20 from the top, and padding will adjust the text position in the button or text view etc. for example, padding value is 20 from the left, so it will adjust the position of the text.

提交回复
热议问题