安卓开发24:FrameLayout布局
来源:互联网 发布:youtube是什么软件 编辑:程序博客网 时间:2024/06/08 06:05
FrameLayout布局
FrameLayout是五大布局中最简单的一个布局。FrameLayout布局中的元素会根据先后顺序重叠起来。利用FrameLayout布局元素重叠的特性,我们一般可以做一些层的隐藏和显示,以及在一个图片上放置另外一个小图标等这样的功能。
看代码:
<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <!-- 底图 --> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:src="@drawable/test1" /> </LinearLayout> <!-- 这个视图会覆盖在上面那个图的上方 --> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="100dp" android:layout_marginTop="100dp" android:src="@drawable/ic_launcher" /> </LinearLayout> <!-- 不可见视图 --> <ImageView android:id="@+id/imageView3" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/jhs_button1_h4" /></FrameLayout>
效果:第一张图在最底下,第二张图在上面,第三张图被gone隐藏了。
- 安卓开发24:FrameLayout布局
- 安卓布局之FrameLayout布局
- 安卓布局 - 帧布局(FrameLayout)
- 【安卓篇】安卓六大布局【三】:FrameLayout布局
- [一个星期自学安卓]帧布局FrameLayout
- android 开发布局之FrameLayout
- 【Android 开发教程】FrameLayout帧布局
- Android开发——FrameLayout布局
- FrameLayout布局
- FrameLayout布局
- FrameLayout布局
- FrameLayout布局
- FrameLayout布局
- FrameLayout布局
- Framelayout 布局
- FrameLayout布局
- FrameLayout布局
- 安卓开发学习之008 FrameLayout应用之扑克牌的动静态显示
- linux shell 流程控制(条件if,循环【for,while】,选择【case】语句实例
- 夏秋之交冷热交替,导致连串肌肤问题出现
- linux下vi编辑器命令大全
- windows下Python模块的安装
- Javascript编程风格
- 安卓开发24:FrameLayout布局
- 软件设计之UML中的六大关系
- POJ_2891_Strange Way to Express Integers(非互质的中国剩余定理)
- C语言深度解剖读书笔记(3.预编译处理)
- HTML中的转义字符
- jQuery学习笔记--开篇(一)
- 设计模式--单例模式(Singleton)
- linux---任务分配(PBS)
- 可视化平台VisualNet的优势