「喵神成长史」『布局篇』FrameLayout(帧布局)
2015-11-15 01:28
288 查看
帧布局基本介绍:
帧布局在屏幕上直接开辟出一块空白区域,当往里面添加组件时,所有的组件都会在这片区域。帧布局在游戏中用的比较多,也是比较简单的一个布局。重要的xml属性:
属性 | 说明 |
---|---|
foregound | 设置帧布局的前景图像 |
foregoundGravity | 设置帧布局前景图像的位置 |
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:foreground="@drawable/e5" android:foregroundGravity="bottom|left" > <TextView android:layout_height="300dp" android:layout_width="300dp" android:background="#7162FF"/> <TextView android:layout_height="180dp" android:layout_width="180dp" android:background="#FF265B"/> <TextView android:layout_height="100dp" android:layout_width="100dp" android:background="#51FF5F"/> </FrameLayout>
运行:
还是可以看出,后来的TextView会覆盖在以前TextView上,而右下角用了foregound属性的图片覆盖在三个TextView上
相关文章推荐
- <base href="<%=basePath %>"> 设置整个项目的全局变量
- 带参数启动另外一个exe程序
- SQL大数据量查询的优化
- 读书笔记——《暗时间》
- 博客开张
- MySQL备份与恢复
- android怎么打开wifi的组播功能
- Android适配器——ArrayAdapter的各种重载
- 不同场景下 MySQL 的迁移方案
- 《并查集》hdu acm 5.1.7 c++ map的使用
- Git常用命令
- Android MulticastSocket IP组播
- 10 种机器学习算法的要点(附 Python 和 R 代码)
- Python_元组、字典内建方法详解
- 王爽 第三版 监测点1.1习题
- 搭建maven+spring+freemaker+mybatis环境之四
- 为 Key-Value 数据库实现MVCC 事务
- springMVC教程-快速入手-深入分析
- 拼接字符串和整型值
- HTML DOM 介绍