zoukankan      html  css  js  c++  java
  • ndroid:paddingLeft与android:layout_marginLeft的区别

    这个是同CSS中的布局是一个道理:

    详细解释如下图:

    如上图所示:

    外面是最大的一个BOX,里面有2个button,

    2个button之间的边距就是margin(外边距),因为他们都同属于同一个box中。

    而button和box之间的边距就死内边距padding,因为他们是在box里面。

    有了这个只是就很好理解android中的布局方式:

    android:paddingLeft="30px"       这个相当于他所在容器中的距左内边距30个像素。

    android:layout_marginLeft="30px"   这个相当于和他同级的容器的左外边距30个像素

    呵呵  其他的上下什么的都是一个道理。

  • 相关阅读:
    左孩子右兄弟的字典树
    UVA 1401 Remember the Word
    HDOJ 4770 Lights Against Dudely
    UvaLA 3938 "Ray, Pass me the dishes!"
    UVA
    Codeforces 215A A.Sereja and Coat Rack
    Codeforces 215B B.Sereja and Suffixes
    HDU 4788 Hard Disk Drive
    HDU 2095 find your present (2)
    图的连通性问题—学习笔记
  • 原文地址:https://www.cnblogs.com/yaowukonga/p/2506110.html
Copyright © 2011-2022 走看看