android 布局

1

布局类型
    特有属性
LinearLayout
线性布局
orientation

布局内的空间的排列方式

vertical(垂直默认
horizontal(水平)
 
layout_weight
 控件所占控件比重(将会拉伸控件)
RelativeLayout
相对布局  
layout_align+方位
 
layout_alignParent+方位
 
TableLayout
表格布局  
FrameLayout
框架布局  
AbsoluteLayout
绝对布局  
共有属性
layout_width,
layout_height

 设置控件宽高:

1.固定宽高

2.wrap_content 其所需要的最小尺寸

3.match_parent 充满父布局

 
layout_margin+方位
 控件边缘相对父控件的边距
 
padding+方位
 控件内容的边缘相对控件的边距
 
layout_gravity

 控件相对父控件的居中位置

1.center       正居中
2.center_horizontal 水平居中
3.center_vertical  垂直居中
 
gravity
 控件内容相对控件的居中位置
   
   
posted @ 2018-09-04 09:29  liuyj_vv  阅读(113)  评论(0编辑  收藏  举报