Android 布局

参考文献:https://www.cnblogs.com/ludashi/p/4883915.html

LinearLayout (线性布局)
RelativeLayout (相对布局)
FrameLayout (帧布局)
TableLayout (表格布局)

match_parent
wrap_content

orientation
水平:horizontal
垂直:vertical

gravity:
layout_gravity: 对齐方式
垂直布局对齐方式 left,center,right
水平布局对齐方式top,center,bottom

layout_weight: 允许以比例形式指定控件大小

相对布局

layout_above
layout_below
layout_toLeftOf
layout_toRightOf

帧布局
坐标点 (0,0) 已经固定死了,所以只需要更改宽高。

表格布局

(备注:)

FrameLayout 能实现的优先使用FrameLayout

其次优先选择RelativeLayout

再次当RelativeLayout和LinearLayout同时能满足需求时,优先选择LinearLayout

你可能感兴趣的:(Android 布局)