帧布局FrameLayout中全部的控件都在界面的左上側,后绘制的空间会覆盖之前的控件。布局内控件以层叠方式显示,用在游戏开发方面可能多些.

1.层叠展示

                以下这个样例中,3个textview以层叠方式显示,通过大小和颜色我们来展示下这3个控件的层叠方式
 
                    
<?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" > <TextView
android:layout_width="300dp"
android:layout_height="300dp"
android:text="游响云停工作室"
android:gravity="center"
android:background="#FFE4B5"
/> <TextView
android:id="@+id/textView1"
android:layout_width="150dp"
android:layout_height="120dp"
android:text="游响云停工作室"
android:gravity="center"
android:background="#D1EEEE"
/> <TextView
android:layout_width="100dp"
android:layout_height="50dp"
android:text="游响云停工作室"
android:gravity="center"
android:background="#EEB422"
/> </FrameLayout>

2.商品列表演示样例

   

<?

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" > <ImageView
android:id="@+id/imageView1"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@raw/pad" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品名称:Ipad Air"
android:layout_marginLeft="120dp"
android:layout_marginTop="10dp"
/> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品金额:$20" android:layout_marginLeft="120dp"
android:layout_marginTop="40dp"
/> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品颜色:白色"
android:layout_marginLeft="120dp"
android:layout_marginTop="70dp"
/> <TextView
android:layout_width="fill_parent"
android:layout_height="3dp"
android:text=""
android:layout_marginLeft="0dp"
android:layout_marginTop="110dp"
android:background="#D1EEEE"
/> <ImageView
android:id="@+id/imageView2"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginTop="120dp"
android:src="@raw/pad" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品名称:Ipad Air"
android:layout_marginLeft="120dp"
android:layout_marginTop="140dp"
/> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品金额:$20" android:layout_marginLeft="120dp"
android:layout_marginTop="170dp"
/> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品颜色:白色"
android:layout_marginLeft="120dp"
android:layout_marginTop="200dp"
/> <TextView
android:layout_width="fill_parent"
android:layout_height="3dp"
android:text=""
android:layout_marginLeft="0dp"
android:layout_marginTop="220dp"
android:background="#D1EEEE"
/> </FrameLayout>



版权声明:本文博客原创文章。博客,未经同意,不得转载。

.Net程序猿乐Android发展---(10)框架布局FrameLayout的更多相关文章

  1. .Net程序猿乐Android发展---(1)环境结构

    对于没有接触Android人才发展,你可能会觉得Android更难以发展.接下来的一段时间,我们将了解Android开发的详细细节,主要是面对.NET程序猿,来看看.NET程序猿如何进行Android ...

  2. .Net程序猿乐Android开发---(4)注册页面布局

    接下来我们介绍的登陆页面布局,在本节中,我们看一下注册页面布局,页面布局大同小异,来一起熟悉下基本控件的使用方法. 效果图: 1.加入注冊页面 右键选中layout目录,加入注冊页面.例如以下图 点击 ...

  3. 框架布局FrameLayout

    框架布局FrameLayout 一.简介 二.代码实例 结果图: 代码: 需要注意的代码: imageView_play.setVisibility(View.INVISIBLE); <Fram ...

  4. Android 自学之帧布局 FrameLayout

    帧布局(FrameLayout)直接继承了ViewGroup组件: 帧布局容器为每一个加入其中的组件都创建了一个空白的区域,这个区域我们称之为一帧,所有每个组件都占据一帧,这些都会根据gravity属 ...

  5. Java程序猿必知的10个调试技巧

    在本文中,作者将使用大家经常使用的的开发工具Eclipse来调试Java应用程序.但这里介绍的调试方法基本都是通用的,也适用于NetBeans IDE,我们会把重点放在运行时上面. 在開始之前,推荐大 ...

  6. Android 框架布局 FrameLayout

    <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android=" ...

  7. Android发展的一个重要方面Makefile分析

    Android发展的一个重要方面Makefile分析 随着移动互联网的发展,移动开发也越来越吃香了.眼下最火的莫过于android.android是什么就不用说了,android自从开源以来,就受到非 ...

  8. 屌丝程序猿赚钱之道 之APP

    假设你已经通过APP赚到了钱,那么本文对你而言没有意义.倒是希望你可以给我们诸多建议. 通过制作APP或者说手机应用赚钱,相信是非常多程序猿希望做的事情.也确实有一些人通过APP赚到了钱. 对于程序猿 ...

  9. CSDN日报20170401 ——《假设你还是“程序猿”,我劝你别创业!》

    [程序人生]假设你还是"程序猿".我劝你别创业! 作者:北漂周 在IT这一行做得久了,会接触到无数让人哭笑不得的外行话. 「我们就差一个写代码的了」是当中典型的一种,之所以黑它.不 ...

随机推荐

  1. Learning Cocos2d-x for WP8(8)——动作Action

    原文:Learning Cocos2d-x for WP8(8)--动作Action 游戏很大程度上是由动作画面支撑起来的. 动作分为两大类:瞬间动作和延时动作. 瞬间动作基本等同于设置节点的属性,延 ...

  2. ServiceStack.Redis里List的Insert操作

    最近用Redis的c#驱动,发现ServiceStack.Redis里List类型的Insert方法调用的时候始终报错,结果反编译dll后,这个方法居然是这样写的: public void Inser ...

  3. NET通用平台

    NET通用平台.通用权限.易扩展.多语言.多平台架构框架 先拿出我半前年前平台的设计初稿,经过半年的努力我已经完成了该设计稿的所有功能.并且理念已经远远超出该设计稿. 下面是一些博友对我贴子的评价: ...

  4. 消息队列(Message Queue)基本概念(转)

    背景 之前做日志收集模块时,用到flume.另外也有的方案,集成kafaka来提升系统可扩展性,其中涉及到消息队列当时自己并不清楚为什么要使用消息队列.而在我自己提出的原始日志采集方案中不适用消息队列 ...

  5. poj2761(treap入门)

    给n个数,然后m个询问,询问任意区间的第k小的数,特别的,任意两个区间不存在包含关系, 也就是说,将所有的询问按L排序之后, 对于i<j ,   Li < Lj 且 Ri < Rj ...

  6. Oracle SQL Lesson (2) - 限制和排序数据

    重建scott用户@?/rdbms/admin/utlsampl.sql@--执行?--$ORACLE_HOME 字符区分大小写:SELECT last_name, job_id, departmen ...

  7. JDBC连接数据库和释放连接

    用久了hibernate现在对于JDBC是怎么实现数据库的连接和释放,所以特地总结下关于JDBC的知识,目的是用于提醒自己很多Java的基础知识需要健全. package com.ssh.action ...

  8. SQL Server :理解数据页结构

    原文:SQL Server :理解数据页结构 我们都很清楚SQL Server用8KB 的页来存储数据,并且在SQL Server里磁盘 I/O 操作在页级执行.也就是说,SQL Server 读取或 ...

  9. 广域网佰腾玩O2O笑话——它看起来很漂亮,注定不低于

    据说 2014.8.29:中国最大的商业运营商万达在一起的互联网服务供应商百度.腾讯在深圳(属性)战略合作签约仪式举行. 从功能表面上.万达代表实体,百度代表数据.腾讯代表社区:按三个合伙人理解,是要 ...

  10. 二十7天 春雨滋润着无形 —Spring依赖注入

    6月11日,明确."夏条绿已密,朱萼缀明鲜.炎炎日正午,灼灼火俱燃." IT人习惯把详细的事物加工成的形状一致的类.正是这种一致,加上合适的规范.才干彰显对象筋道的牙感和bean清 ...