zoukankan      html  css  js  c++  java
  • padding与margin的差别

    之前一直没有搞懂android:padding和android:layout_margin的差别,事实上概念非常easy,padding是站在父view的角度描写叙述问题,它规定它里面的内容必须与这个父view边界的距离。margin则是站在自己的角度描写叙述问题,规定自己和其它(上下左右)的view之间的距离,假设同一级仅仅有一个view,那么它的效果基本上就和padding一样了。比如我的XML layout代码例如以下:

     那么我会得到例如以下的效果,图上已经非常明白的标出来差别咯。

    padding和margin的差别

  • 相关阅读:
    【leetcode】Binary Search Tree Iterator
    【leetcode】Palindrome Partitioning II
    【leetcode】Best Time to Buy and Sell Stock III
    【leetcode】Best Time to Buy and Sell Stock II
    【leetcode】Longest Consecutive Sequence
    【leetcode】Factorial Trailing Zeroes
    【leetcode】Simplify Path
    【leetcode】Generate Parentheses
    【leetcode】Combination Sum II
    【leetcode】Combination Sum
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/3869671.html
Copyright © 2011-2022 走看看