FrameLayout:帧布局,可以显示图片的动画效果

前景图像:
永远处于帧布局最顶的,直接面对用户的图像,,就是不会被覆盖的图片

常用属性:

android:foreground:设置该帧布局容器的前景图像

android:foregroundGravity:设置前景图像显示的位置

2.实例演示

1)最简单的例子

运行效果图:

实现代码如下:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/FrameLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:foreground="@drawable/logo"
android:foregroundGravity="right|bottom"> <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>

代码解析: 很简单,三个TextView设置不同大小与背景色,依次覆盖,接着右下角的是前景图像,通过 android:foreground="@drawable/logo"设置前景图像的图片, android:foregroundGravity="right|bottom"设置前景图像的位置在右下角

android FrameLayout的更多相关文章

  1. android FrameLayout详解

    首先看演示: FrameLayout框架布局是最简单的布局形式.所有添加到这个布局中的视图都以层叠的方式显示.第一个添加的控件被放在最底层,最后一个添加到框架布局中的视图显示在最顶层,上一层的控件会覆 ...

  2. Android FrameLayout单帧布局

    FrameLayout:所有控件位于左上角,并且直接覆盖前面的子元素. 在最上方显示的层加上: android:clickable="true" 可以避免点击上层触发底层. 实例: ...

  3. Android - FrameLayout覆盖顺序

    FrameLayout覆盖顺序 本文地址: http://blog.csdn.net/caroline_wendy FrameLayout: Child views are drawn in a st ...

  4. [原创]在Framelayout中放置button控件出现的覆盖问题

    android Framelayout(帧布局)是很常用的布局,主要用来处理需要多个view叠加显示的情况. 然而在使用中,我发现Framelayout中的Button控件,会挡住所有其他控件,而不论 ...

  5. android捕获ListView中每个item点击事件

    转自:http://www.cnblogs.com/pswzone/archive/2012/03/10/2389275.html package com.wps.android;   import  ...

  6. 《Pro Android Graphics》读书笔记之第六节

    Android UI Layouts: Graphics Design Using the ViewGroup Class Android ViewGroup Superclass: A Founda ...

  7. Android PullToRrefresh 自定义下拉刷新动画 (listview、scrollview等)

    PullToRefreshScrollView 自定义下拉刷新动画,只需改一处. 以下部分转载自http://blog.csdn.net/superjunjin/article/details/450 ...

  8. PullToRefresh的个性化扩展

    一:实现区别下拉刷新和上拉加载 参考资料:http://blog.csdn.net/losetowin/article/details/18261389 在PullToRefresh的类库的com.h ...

  9. View,viewgroup,viewstub总结

    :first-child { margin-top: 0; } blockquote > :last-child { margin-bottom: 0; } img { border: 0; m ...

随机推荐

  1. Python3.5 学习五

    心灵鸡汤电影推荐: 阿甘正传.辛德勒名单.肖申克的救赎.勇敢的心.角斗士.美国丽人.教父.钢琴师.指环王.西雅图不眠夜.廊桥遗梦.可可西里的美丽传说.放牛班的春天.血钻.战争之王.上帝之城.中央车站. ...

  2. 【Oracle 12c】CUUG OCP认证071考试原题解析(30)

    30.choose the best answer Examine the commands used to create DEPARTMENT_DETAILS and COURSE_DETAILS: ...

  3. 【Oracle 12c】CUUG OCP认证071考试原题解析(29)

    29.choose the best answer Evaluate the following query: SQL> SELECT promo_name || q'{'s start dat ...

  4. js判断手机端操作系统的两种方法

    //判断手机端操作系统(Andorid/IOS),并自动跳转相应下载界面 androidURL ="http://xxx/xxx.apk"; var browser = { ver ...

  5. day 02 ---class - homework

    # -*- coding: utf-8 -*-# @Time : 2018/12/20 14:34# @Author : Endless-cloud# @Site : # @File : day 02 ...

  6. [转]NSProxy实现AOP方便为ios应用实现异常处理策略

    [转载自:http://blog.csdn.net/yanghua_kobe/article/details/8395535] 前段时间关注过objc实现的AOP,在GitHub找到了其中的两个库:A ...

  7. QuantLib 金融计算——基本组件之 Schedule 类

    目录 QuantLib 金融计算--基本组件之 Schedule 类 Schedule 对象的构造 作为"容器"的 Schedule 对象 一些常用的成员函数 如果未做特别说明,文 ...

  8. Objective-C 之category

    参考资料:iOS设计模式——Category Category Category模式用于向已经存在的类添加方法从而达到扩展已有类的目的. 相当于Swift中的功能扩展(extension). 新添加的 ...

  9. Mac下Homebrew的图形化界面工具Cakebrew

    安装: brew cask install cakebrew 如果不能下载直接上官网下载dmg包进行安装. 参考: https://www.cakebrew.com/ https://github.c ...

  10. 【ORACLE】ORACLE session(会话)管理

    #查看当前不为空的连接select * from v$session where username is not null #查看不同用户的连接数 select username,count(user ...