android setPadding()跟setMargins()

padding是控件的内容相对控件的边缘的边距.
margin是控件边缘相对父控件,或者其他控件的边距.

  button.layout(left, top, right,bottom);
其中left,top,bottom,right分别表示控件(button)的四个边界距离parent的上边界和左边界的距离。
left,right对应左边界的距离;top,bottom对应上边界的距离

padding 的属性顺序是left,top,right,bottom

原文地址:https://www.cnblogs.com/dreamy890322/p/3118858.html