关于UI设计的Layout_margin和Padding

2018年03月20日 16:31:21 shirley_zx 阅读数:151 标签: Android UI XML 更多

个人分类: Android

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zx_emily/article/details/79627136

Layout_margin

layout_marginTop: 该控件距离上面控件的最小距离

layout_marginBottom: 该控件距离下面控件的最小距离

layout_marginLeft和layout_marginRight同理

单独layout_margin是该控件上下左右都留有的同样的距离

如果上面控件和下面控件都设置了layout_marginBottom和layout_marginTop,那么二者的距离就是layout_marginBottom和layout_marginTop相加的距离。

对于上一个控件的理解:对于Linearlayout而言,layout_marginTop就是对父控件的距离,此时想要设置控件与相邻控件的距离需要人为制定:android:layout_below="@id/project"。而对于RelativeLayout而言,是两个控件的距离。

 

 

Padding

Padding是设置内容与控件边框的上下左右距离的

PaddingTop:设置内容与上边框的距离

PaddingBottom,PaddingLeft,PaddingRight与此类似

关于UI设计的Layout_margin和Padding

相关文章:

  • 2021-11-17
  • 2021-11-07
  • 2022-12-23
  • 2021-10-23
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2021-04-28
猜你喜欢
  • 2022-12-23
  • 2021-07-02
  • 2022-01-17
  • 2021-05-01
  • 2022-12-23
  • 2021-06-23
  • 2022-12-23
相关资源
相似解决方案