[Android]学习笔记之布局

5大布局,其中前3个是常用的,第四个绝对布局已经提示deprecated

![](http://images2015.cnblogs.com/blog/194303/201611/194303-20161116155237685-168648338.png)

RelativeLayout相对布局的3类方法

  • android:layout_alignParentBottom="true"是相对父容器的位置
  • android:layout_alignLeft="@+id/button" 对齐其它容器的边界
  • android:layout_toRightOf="@+id/button" 是相关其它控件的位置
  • 设置button3在button2的下面和button5的右面

其它

  • 通过include引用其它的视图: <include layout="@layout/activity_splash"/>
  • 通过merge,可以减少include时候的层级数量:include的时候不会引用标识为merge的这一层
原文地址:https://www.cnblogs.com/xiuj/p/6069893.html