当前位置: 首页 > news >正文

.Net程序猿乐Android发展---(10)框架布局FrameLayout

                    帧布局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>




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

转载于:https://www.cnblogs.com/blfshiye/p/4655492.html

相关文章:

  • 这个世界并不亏欠我们什么——Leo网上答疑52
  • 《python核心编程》笔记——文件的创建、读取和显示
  • 详解TCC89x的LCD数值设置
  • gentoo系统安装
  • 你为什么不写注释?
  • GO语言练习:网络编程 TCP 示例
  • “梳子”的用途很大
  • Linux监控本机当前状态命令
  • eclipse中svn的各种状态图标详解
  • 201507221403_《backbone之一——新建模型和集合、实例化模型、模型上监听事件的方法、模型设置和获取后台数据、配置理由方法、视图绑定事件的方法、绑定模型等》...
  • Android HAL实例解析
  • 15款优秀移动APP产品原型设计工具
  • ThreadPoolExecutor运转机制详解
  • 图片垂直居中在中间
  • MeeGo handset 1.1开发环境[5]:一个desktop小应用
  • 2017年终总结、随想
  • 3.7、@ResponseBody 和 @RestController
  • 4. 路由到控制器 - Laravel从零开始教程
  • Android优雅地处理按钮重复点击
  • gops —— Go 程序诊断分析工具
  • HashMap ConcurrentHashMap
  • Invalidate和postInvalidate的区别
  • JavaScript对象详解
  • Phpstorm怎样批量删除空行?
  • React-Native - 收藏集 - 掘金
  • Spring思维导图,让Spring不再难懂(mvc篇)
  • 测试开发系类之接口自动化测试
  • 分布式事物理论与实践
  • 给第三方使用接口的 URL 签名实现
  • 前端每日实战:61# 视频演示如何用纯 CSS 创作一只咖啡壶
  • 腾讯视频格式如何转换成mp4 将下载的qlv文件转换成mp4的方法
  • 微信开放平台全网发布【失败】的几点排查方法
  • Java总结 - String - 这篇请使劲喷我
  • 积累各种好的链接
  • #传输# #传输数据判断#
  • (HAL)STM32F103C6T8——软件模拟I2C驱动0.96寸OLED屏幕
  • (Matalb分类预测)GA-BP遗传算法优化BP神经网络的多维分类预测
  • (简单) HDU 2612 Find a way,BFS。
  • (算法)Game
  • (学习日记)2024.03.12:UCOSIII第十四节:时基列表
  • (转)从零实现3D图像引擎:(8)参数化直线与3D平面函数库
  • *_zh_CN.properties 国际化资源文件 struts 防乱码等
  • .md即markdown文件的基本常用编写语法
  • .NET DevOps 接入指南 | 1. GitLab 安装
  • .Net MVC + EF搭建学生管理系统
  • .Net 中Partitioner static与dynamic的性能对比
  • .NET性能优化(文摘)
  • .net专家(高海东的专栏)
  • .set 数据导入matlab,设置变量导入选项 - MATLAB setvaropts - MathWorks 中国
  • @SpringBootApplication 包含的三个注解及其含义
  • @SuppressLint(NewApi)和@TargetApi()的区别
  • [2015][note]基于薄向列液晶层的可调谐THz fishnet超材料快速开关——
  • [ActionScript][AS3]小小笔记
  • [Android View] 可绘制形状 (Shape Xml)
  • [ArcPy百科]第三节: Geometry信息中的空间参考解析