Android_02_帧布局
2015-10-14 11:39
351 查看
代码示例如下:
实际效果如下:
<?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" > <!-- 帧布局: 各组件默认是左上角,组件之间可以重叠 可以设置上下左右对齐,水平居中,其设置方式和线性布局一样 但是与线性布局相比,其并没有水平布局和竖直布局之分 如:在帧布局中,可以实现: android:layout_gravity="right|bottom" 表示组件置于右下角的位置 --> <TextView android:layout_width="300dp" android:layout_height="300dp" android:background="#ffff4444" android:layout_gravity="center" /> <TextView android:layout_width="250dp" android:layout_height="250dp" android:background="#00ff00" android:layout_gravity="center" /> <TextView android:layout_width="200dp" android:layout_height="200dp" android:background="#0000ff" android:layout_gravity="center" /> <TextView android:layout_width="150dp" android:layout_height="150dp" android:background="#ffffbb33" android:layout_gravity="center" /> <TextView android:layout_width="100dp" android:layout_height="100dp" android:background="#ffaa66cc" android:layout_gravity="center" /> <TextView android:layout_width="100dp" android:layout_height="100dp" android:background="#ffffff" android:layout_gravity="center" /> </FrameLayout>
实际效果如下:
相关文章推荐
- Android属性动画-Property Animation(四) 组合动画
- SEAndroid安全机制框架分析
- Android系统移植与调试之------->如何修改Android手机显示的4G信号强度的格子数
- Android资源笔记
- 【菜鸟嵌入式学习分享】4412开发板Android4.4.4环境的搭建和编译
- android三方类库
- android 中如何限制 EditText 最大输入字符数
- Android中的dispatchTouchEvent()、onInterceptTouchEvent()和onTouchEvent()
- Android项目导入support v7包时遇到的各种问题
- Android中ImageView使用网络图片资源的方法
- Material Design with the Android Design Support Library
- Android -- Facebook -- HashKey的生成
- Android Intent Action详解
- android 前置service
- android 6.0权限管理特性
- 关于android第三方包混淆的经验总结
- Android之switch控件的用法
- Android性能专项测试之Batterystats
- Android: ADT 23.0.2
- 捕android程序崩溃日志