android 类型
来源:互联网 发布:全球互联网大会 知乎 编辑:程序博客网 时间:2024/06/05 15:08
1.GridLayout布局
此布局是实现网格布局
rowCount="num"----num是具体数值,是网格的行数
columnCount="num"---同上,实现网格的列数
1>layout_columnSpan="num"同上,实现网格列的合并
layout_rowCount="num"同上,实现网格行的合并
2.FrameLayout 单帧布局
单帧布局结构简单,所有子元素部分覆盖或全部覆盖前面的元素,而且都位于左上角
3.AbsoluteLayout 绝对位置布局
以屏幕上的左上角为原点(0,0),横的为X,纵的为Y,都为正值。子元素可以相互重叠,适配性不好,较少使用
此布局是实现网格布局
rowCount="num"----num是具体数值,是网格的行数
columnCount="num"---同上,实现网格的列数
1>layout_columnSpan="num"同上,实现网格列的合并
layout_rowCount="num"同上,实现网格行的合并
合并时要用到layout_gravity="fill"
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:rowCount="7" android:columnCount="4"> <TextView android:layout_columnSpan="4" android:text="0" android:textSize="@dimen/font32" android:layout_row="1" android:layout_column="0" /> <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:inputType="time" android:ems="10" android:id="@+id/editText3" android:layout_row="0" android:layout_column="2" /> <Button android:text="1" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_row="2" android:layout_column="0" /> <Button android:text="2" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="2" android:layout_column="1" /> <Button android:text="3" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="2" android:layout_column="2" /> <Button android:text="+" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="2" android:layout_column="3" /> <Button android:text="4" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="3" android:layout_column="0" /> <Button android:text="5" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="3" android:layout_column="1" /> <Button android:text="6" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="3" android:layout_column="2" /> <Button android:text="-" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="3" android:layout_column="3" /> <Button android:text="=" android:textSize="20sp" android:layout_margin="5dp" android:layout_rowSpan="2" android:layout_gravity="fill" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="4" android:layout_column="0" /> <Button android:text="7" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="4" android:layout_column="1" /> <Button android:text="8" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="4" android:layout_column="2" /> <Button android:text="*" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="4" android:layout_column="3" /> <Button android:text="9" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="5" android:layout_column="1" /> <Button android:text="0" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="5" android:layout_column="2" /> <Button android:text="\" android:textSize="20sp" android:layout_margin="5dp" android:background="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="5" android:layout_column="3" /></GridLayout>
2.FrameLayout 单帧布局
单帧布局结构简单,所有子元素部分覆盖或全部覆盖前面的元素,而且都位于左上角
3.AbsoluteLayout 绝对位置布局
以屏幕上的左上角为原点(0,0),横的为X,纵的为Y,都为正值。子元素可以相互重叠,适配性不好,较少使用
0 0
- android 类型
- android MINE类型总汇
- Android常用mimetype类型
- Android常用mimetype类型
- Android MIME类型结构
- Android 常用mimetype类型
- Android MIME类型
- android动画类型
- Android动画类型
- Android布局类型概述
- Android JNI 类型转换
- android 的MIME类型
- Android常用mimetype类型
- Android 移动网络类型
- Android 移动网络类型
- android的MIME类型
- android动画类型
- ANDROID屏幕类型
- POJ 1987Distance Statistics 树的分治
- Linux中如何添加/删除FTP用户并设置权限(后续)
- Mysql 总结(一)
- HuaXinIM聊项目阶段总结六(获取历史信息实现)
- JDK里的设计模式
- android 类型
- 20非常有用的Java程序片段
- Aurora编辑LaTex公式基本用法教程
- C++运算符重载
- 程序员的520表达方式
- POJ 1208 The Blocks Problem
- C++ 文件输入输出(四)
- Linux下进程的通信方式: 有名管道(命名管道)
- Python基础笔记