详解四种基本布局
来源:互联网 发布:淘宝卖家版电脑版 编辑:程序博客网 时间:2024/06/06 20:34
1.线性布局
android:orientation="vertical"/"horizontal"
如果LinearLayout的排列方向是horizontal,内部的控件就绝对不能将宽度指定为match_parent,同样,veritical不能将高度指定为match_parent
android:layout_weight:允许我们使用比例的方式来指定控件的大小
dp是Android中用于指定控件大小,间距等属性的单位
android:layout_width="0dp"
先把LinearLayout下所有控件的layout_weight值相加,得到一个总值,然后每个控件所占大小的比例就是用该控件的layout_weight值除以刚才总值。
android:gravity(指定文字在控件中的对齐方式)
android:layout_gravity(指定控件在布局中的对齐方式)
2.相对布局RelativeLayout
3.帧布局FrameLayout
4.百分比布局
app:layout_widthPercent="50%"
app:layout_heightPercent="50%"
阅读全文
0 0
- 详解四种基本布局
- 详解四种基本布局
- 详解Android四种基本布局
- 3.3详解四种基本布局
- 四种基本布局
- 四种基本布局
- 四种基本布局
- 四种基本布局
- 第一行代码3.3-详解四种基本布局
- 第一行代码之详解四种基本布局
- 07读书笔记之详解四种基本布局
- android-四种基本布局
- Android四种基本布局
- Android, 四种基本布局
- 【Android】四种基本布局
- Android四种基本布局
- Android四种基本布局
- Android开发之基本控件和详解四种布局方式
- WebRTC实时通信系列教程2 概述
- 476. Number Complement
- cordova-plugin-file 应用
- GCD XOR UVA
- (STM32 A串口2)接收(STM32 B数据printf2),同时STM32 A使用串口1printf给电脑
- 详解四种基本布局
- Eclipse右键Run as Java application 错误: 找不到或无法加载主类 问题解决方案
- 2017 Multi-University Training Contest
- Android 人脸识别————关于虹软人脸识别SDK引擎使用总结
- tomcat小知识-请求乱码解决方案
- 嵌入式系统概论-1.1
- 剑指offer--机器人运动范围
- 使用BotDetect Captcha在SpringMCV项目中生成验证码图片
- 蓝桥杯练习题 BASIC-1 闰年判断