目录

线性布局:

相对布局


安卓的UI层次体系:

Android的UI布局

线性布局LinearLayout

  • 方向  android::orientation (vertical/horizotal)

  • 重力  gravity (bottom|right, center……)

  • 权重  weight (设置在控件上面,相应方向的宽、高设置为0)

  • getChildAt(int index)得到相应索引的子控件

  • getChildCount()得到子控件的个数

Android的UI布局

相对布局RelativeLayout

  • 相对于容器
  • 相对于控件

Android的UI布局

Android的UI布局

布局共有属性

padding:内容和边框之间的距离

margin:两个控件之间的间距

相关文章:

  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2021-04-26
  • 2021-05-18
  • 2022-03-11
  • 2021-06-20
猜你喜欢
  • 2021-09-25
  • 2021-12-13
  • 2021-05-31
  • 2022-02-09
  • 2021-11-23
  • 2021-12-01
相关资源
相似解决方案