布局Layout
2015-03-17 19:35
78 查看
RelativeLayout相对布局
1)相对父控件的布局
layou_alignParentLeft : 与父控件的左边缘对齐排列
Layout_marginLeft : 与父控件左边缘的距离
layout_alignParentRight : 与父控件的右边缘对齐排列
Layout_marginRight : 与父控件右边缘的距离
layout_alignParentTop : 与父控件的上边缘对齐排列
Layout_marginTop :与父控件上边缘的距离
layout_alignParentBottom :与父控件下边缘对齐排列
Layout_centerHorizontal : 相对父控件水平居中
Layout_centerVertical : 相对父控件垂直居中
Layout_centerInParent : 位于父控件中央
2)相对参考控件布局
layout_alignLeft layout_marginLeft 与参考控件左边缘对齐
layout_alignRight layout_marginRight 与参考控件的右边缘对齐
layout_alignTop layout_marginTop 与参考控件的上边缘对齐
layout_alignBottom layout_marginBottom 与参考控件的下边缘对齐
layout_alignBaseLine 与参考控件的BaseLine对齐
layout_toRightOf 将控件置于参考控件的右边
layout_toLeftOf 将控件置于参考控件的左边
layout_above 将控件置于参考控件的上方
layout_below 将控件置于参考控件的下方
LinearLayout 线性布局
Android:orientation = “vertical”垂直排列
Android:orientation = “horizontal”水平排列
1)相对父控件的布局
layou_alignParentLeft : 与父控件的左边缘对齐排列
Layout_marginLeft : 与父控件左边缘的距离
layout_alignParentRight : 与父控件的右边缘对齐排列
Layout_marginRight : 与父控件右边缘的距离
layout_alignParentTop : 与父控件的上边缘对齐排列
Layout_marginTop :与父控件上边缘的距离
layout_alignParentBottom :与父控件下边缘对齐排列
Layout_centerHorizontal : 相对父控件水平居中
Layout_centerVertical : 相对父控件垂直居中
Layout_centerInParent : 位于父控件中央
2)相对参考控件布局
layout_alignLeft layout_marginLeft 与参考控件左边缘对齐
layout_alignRight layout_marginRight 与参考控件的右边缘对齐
layout_alignTop layout_marginTop 与参考控件的上边缘对齐
layout_alignBottom layout_marginBottom 与参考控件的下边缘对齐
layout_alignBaseLine 与参考控件的BaseLine对齐
layout_toRightOf 将控件置于参考控件的右边
layout_toLeftOf 将控件置于参考控件的左边
layout_above 将控件置于参考控件的上方
layout_below 将控件置于参考控件的下方
LinearLayout 线性布局
Android:orientation = “vertical”垂直排列
Android:orientation = “horizontal”水平排列
相关文章推荐
- [leetcode]Triangle
- 通讯录结构体方法的实现 和VS中存在的一些问题的分析
- 第二周 项目一--旱冰场造价
- angular note2
- Codeforces 487D. Conveyor Belts 分块+DP
- 代码优化的艺术
- 大数据在金融行业的应用
- BZOJ 3621 我想那还真是令人高兴啊 复数
- synchronized(this)与synchronized(class)
- hbase基本概念和hbase shell经常使用命令使用方法
- poj 1743
- 3Sum Closest
- STDU 2878 概率dp
- 实时系统还是分时操作系统
- [leetcode]Sum Root to Leaf Numbers
- js clientTop
- Android屏幕尺寸适配注意事项
- android shape 画圆 画环
- Log4j 2.x入门
- bootstrap jQuery Ztree异步载入数据,check选择&可加入、改动、删除节点