FrameLayout AbsoluteLayout GridLayout用法及实例
FrameLayout AbsoluteLayout GridLayout用法及实例
FrameLayout
一:定义
帧布局每一个组件代表一个画面,默认以左上角(0,0)为零点,按组件的先后顺序显示,后面的组件可以覆盖前面的组件。该布局可以实现动画效果。为避免重叠,可以加上margin属性。
二:使用范围
手机通讯录的显示,帧动画。
AbsoluteLayout
定义:可以用android:layout_x和android:layout_y来指定其绝对位置。但因为安卓程序碎片化的原因,不推荐使用。
GridLayout
一:特性
1:android 4.0以上使用
2:可以实现合并行合并列的效果
二:常用命令
1:android:layout_columnSpan
2: android:layout_rowSpan
3: android:gravity
三:实例
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="wrap_content"android:layout_height="wrap_content"android:columnCount="4" ><Buttonandroid:id="@+id/mum1"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="1" /><Buttonandroid:id="@+id/mum2"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="2" /><Buttonandroid:id="@+id/mum3"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="3" /><Buttonandroid:id="@+id/chu"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="/" /><Buttonandroid:id="@+id/mum4"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="4" /><Buttonandroid:id="@+id/mum5"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="5" /><Buttonandroid:id="@+id/mum6"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="6" /><Buttonandroid:id="@+id/cheng"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="*" /><Buttonandroid:id="@+id/mum7"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="7" /><Buttonandroid:id="@+id/mum8"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="8" /><Buttonandroid:id="@+id/mum9"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="9" /><Buttonandroid:id="@+id/jian"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="-" /><Buttonandroid:id="@+id/mum0"android:layout_height="wrap_content"android:layout_width="wrap_content"android:layout_columnSpan="2"android:layout_gravity="fill"android:text="0" /><Buttonandroid:id="@+id/dian"android:layout_height="wrap_content"android:layout_width="wrap_content"android:text="." /><Buttonandroid:id="@+id/jia"android:layout_height="wrap_content"android:layout_width="wrap_content"android:layout_rowSpan="2"android:layout_gravity="fill"android:text="+" /><Buttonandroid:id="@+id/deng"android:layout_height="wrap_content"android:layout_width="wrap_content"android:layout_columnSpan="3"android:layout_gravity="fill"android:text="=" /></GridLayout>
实现的效果图
四:和tableLayout的区别
tablelayout中通过定义tablerow来显示,而gridlayout则是可以直接使用控件,tablelayout中只能合并行,但gridlayout既能合并行,也能合并列。
FrameLayout AbsoluteLayout GridLayout用法及实例相关推荐
- C# Timer用法及实例详解
1.C# Timer用法及实例详解 http://developer.51cto.com/art/200909/149829.htm http://www.cnblogs.com/OpenCoder/ ...
- boost::make_nvp用法的实例
boost::core模块boost::make_nvp用法的实例 实现功能 C++实现代码 实现功能 boost::core模块boost::make_nvp用法的实例 C++实现代码 #inclu ...
- boost::iterator的用法测试实例
boost::core模块boost::iterator的用法测试实例 实现功能 C++实现代码 实现功能 boost::core模块boost::iterator的用法测试实例 C++实现代码 #i ...
- boost::core::is_same用法测试实例
boost::core模块boost::core::is_same用法测试实例 实现功能 C++实现代码 实现功能 boost::core模块boost::core::is_same用法测试实例 C+ ...
- OpenCV反向项目功能用法的实例(附完整代码)
OpenCV反向项目功能用法的实例 OpenCV反向项目功能用法的实例 OpenCV反向项目功能用法的实例 #include "opencv2/imgproc.hpp" #incl ...
- OpenCV calcOpticalFlowPyrLK用法的实例(附完整代码)
OpenCV calcOpticalFlowPyrLK用法的实例 OpenCV calcOpticalFlowPyrLK用法的实例 OpenCV calcOpticalFlowPyrLK用法的实例 # ...
- OpenCV cv::split用法的实例(附完整代码)
OpenCV cv::split用法的实例 OpenCV cv::split用法的实例 OpenCV cv::split用法的实例 #include <iostream> #include ...
- OpenCV cv::reduce用法的实例(附完整代码)
OpenCV cv::reduce用法的实例 OpenCV cv::reduce用法的实例 OpenCV cv::reduce用法的实例 #include <iostream> #incl ...
- OpenCV cv::merge用法的实例(附完整代码)
OpenCV cv::merge用法的实例 OpenCV cv::merge用法的实例 OpenCV cv::merge用法的实例 #include <iostream> #include ...
- OpenCV cv::Mat::checkVector用法的实例(附完整代码)
OpenCV cv::Mat::checkVector用法的实例 OpenCV cv::Mat::checkVector用法的实例 OpenCV cv::Mat::checkVector用法的实例 # ...
最新文章
- java初学者必看——J2SE小结
- 小议Python3的原生协程机制
- linux 内核发布时间,求问Linux最新内核版本以及发布日期。
- The 15th UESTC Programming Contest Preliminary C - C0ins cdoj1554
- ARM嵌入式开发之JTAG与SWD接口
- phpstorm version 2016.2 License Server激活
- 一张图看懂AR至GL数据流
- Oracle 11G R2(11.0.2.4.0) RAC打PSU(11.2.0.4.11.2.0.4.171017)
- systemverilog随机函数
- python 视频加字幕_Python追风者之视频编辑moviepy
- 绝望的主妇第一二三季/Desperate Housewives迅雷下载
- mysql修改时区方法小结
- 读书笔记软件调试之道 :从大局看调试-零容忍策略
- 微软内部封杀 Slack
- 【差分约束+spfa优化】P3084 [USACO13OPEN]Photo G
- XDL-(1)Linux文件操作命令
- VM VMware Workstation与 Device/Credential Guard 不兼容 Windows下解决方法
- C# 发送xml报文到用友U8生成凭证系列四(Biz代码)最终代码
- 【Baltic2008】黑手党(Mafia)(BSOI2891)
- LCP 47 困住无辜的人 背包装满方案数
热门文章
- elment-ui的table组件多行合并
- MySQL · myrocks · 事务锁分析
- transition animation
- File API文件操作之FileReader二
- 华为手机连不上adb解决方法
- Google浏览器Chrome安装失败,错误代码0xa0430721解决办法
- linux vim 编译python,Ubuntu下编译Vim8(+python)无数次编译失败
- android 挖孔屏适配_娜迦丨不只满足Android 10版本的完美适配,更积极与鸿蒙系统超前对接...
- C程序设计案例(牛顿迭代法求高次方程的根)
- 安装高版本的java_运行“需要Java 11或更高版本”的Visual Studio代码。请下载并安装最新的JDK”...