框架布局(帧布局)是最简单的布局形式。所有添加到这个布局中的视图都以层叠的方式显示。第一个添加的控件被放在最底层,最后一个添加到框架布局中的视图显示在最顶层,上一层的控件会覆盖下一层的控件。这种显示方式有些类似于堆栈。

示例代码

<?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"> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"> <TextView
android:layout_width="200dp"
android:layout_height="200dp"
android:background="#FF6143" /> <TextView
android:layout_width="150dp"
android:layout_height="150dp"
android:background="#7BFE00" /> <TextView
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#FFFF00" />
</FrameLayout> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"> <TextView
android:id="@+id/textview1"
android:layout_width="140dp"
android:layout_height="140dp"
android:layout_gravity="center"
android:background="#FF33ffff" /> <TextView
android:id="@+id/textview2"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center"
android:background="#FF33ccff" /> <TextView
android:id="@+id/textview3"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:background="#FF3399ff" />
</FrameLayout>
</FrameLayout>

效果图

Android布局之FrameLayout的更多相关文章

  1. Android 布局之FrameLayout

    Android 布局之FrameLayout 1 FrameLayout简介 对于FrameLayout,官方介绍是:FrameLayout is designed to block out an a ...

  2. Android布局及属性归总(查询用)

    常见布局 LinearLayout    线性布局        子元素任意,组织成一个单一的水平或垂直行,默认为水平方向TableLayout    表格布局        子元素为<Tabl ...

  3. android布局学习-使用FrameLayout和LinearLayout制作QQ空间底部导航栏

    [声明:本博客通过学习“J灬叶小超 ”博客而写,链接:http://www.cnblogs.com/yc-755909659/p/4288260.html] --------------------- ...

  4. android布局 FrameLayout(帧布局)详解

    看到一篇很有趣的文章对我就是冲着萌妹子看的 FrameLayout(帧布局) 前言 作为android六大布局中最为简单的布局之一,该布局直接在屏幕上开辟出了一块空白区域, 当我们往里面添加组件的时候 ...

  5. Android布局_帧布局FrameLayout

    一.FrameLayout布局概述 在这个布局中,所有的子元素都不能被指定放置的位置,他们统统放于这块区域的左上角,并且后面的子元素直接覆盖在前面的子元素之上,将前面的子元素部分和全部遮挡  如下面的 ...

  6. Android布局详解之一:FrameLayout

      原创文章,如有转载,请注明出处:http://blog.csdn.net/yihui823/article/details/6702273 FrameLayout是最简单的布局了.所有放在布局里的 ...

  7. Android(java)学习笔记93:Android布局详解之一:FrameLayout

    FrameLayout是最简单的布局了.所有放在布局里的控件,都按照层次堆叠在屏幕的左上角.后加进来的控件覆盖前面的控件. 在FrameLayout布局里,定义任何空间的位置相关的属性都毫无意义.控件 ...

  8. Android UI -- 布局介绍(布局包括FrameLayout, LinearLayout, RelativeLayout, GridLayout)

    首先介绍常用布局类 FrameLayout 最简单的布局管理器. 这个布局管理类有几个特性: 添加组件默认在左上角的. 如果添加多个组件会叠加到一起,并且都在左上角.(可以通过一gravity属性改变 ...

  9. Android中的FrameLayout帧布局

    帧布局由FrameLayout所代表,FrameLayout直接继承了ViewGoup组件. 帧布局容器为每一个增加当中的组件创建一个空白的区域(称为一个帧),每一个子组件占领一帧,这些帧都会依据gr ...

随机推荐

  1. 用Beamer做Slides

    学术用幻灯片,首选还是latex.但是问题来了,Beamer这个latex幻灯模板还需要很多自定义设置.于是找了网上一些自己觉得好的例子. http://www.latexstudio.net/ind ...

  2. 【算法】Bellman-Ford算法(单源最短路径问题)(判断负圈)

    单源最短路问题是固定一个起点,求它到其他所有点的最短路的问题. 算法: 设 d[i]  表示 起点 s 离点 i 的最短距离. [1.初始化]  固定起点s,对所有的点 , 如果 i =  s ,  ...

  3. 推荐几个bootstrap 后端UI框架

    转载地址 https://blog.csdn.net/u013816448/article/details/81563051

  4. centos7-centos6常用配置对比

    设置(CentOS 6 vs CentOS 7)系统常用配置 ysvinit vs Upstart vs Systemd) 常见设置: 字符集CentOS 6方法:/etc/sysconfig/i1 ...

  5. 本地yum源安装docker

    Directory listing for / audit-libs-python-2.7.6-3.el7.x86_64.rpm checkpolicy-2.5-4.el7.x86_64.rpm co ...

  6. C/C++中相对路径与绝对路径以及斜杠与反斜杠的区别

    1 绝对路径与相对路径 绝对路径表示相对容易得多,依次将文件所在盘符文件夹逐级展开就是绝对路径: ofstream infile("E:\\MyDoc\\file.txt", io ...

  7. Tarjan 割点割边【模板】

    #include <algorithm> #include <cstring> #include <cstdio> using namespace std; +); ...

  8. MS ACCESS MID函数

    select * from GongCheng where MID(GCWYBH,3,8)='" + time.Date.ToString("yyyyMMdd") + & ...

  9. RubyMine2017破解

    RubyMine2017破解 学习了:https://www.7down.com/soft/172903.html 激活的时候选择 license server; 输入如下地址激活: http://i ...

  10. 微信iOS SDK文档总结

    至今共19个类.分3大类. (1)请求与响应类:微信终端和第三方程序:第三方程序和微信server. BaseReq:全部请求类的基类. GetMessageFromWXReq:微信终端向第三方程序请 ...