android中的帧布局(frameLayout)
2016-04-08 20:12
543 查看
frameLayout的特点:
所有的子元素都默认放在这块区域的左上角,可以通过android:layout_gravity=" "语句改变控件在布局中的位置。后面的子元素会覆盖前面的子元素。
</pre>例:<pre name="code" class="html"><?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" >
<ProgressBar
android:layout_gravity="center"
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_gravity="center"
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="100%" />
</FrameLayout>
所有的子元素都默认放在这块区域的左上角,可以通过android:layout_gravity=" "语句改变控件在布局中的位置。后面的子元素会覆盖前面的子元素。
</pre>例:<pre name="code" class="html"><?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" >
<ProgressBar
android:layout_gravity="center"
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_gravity="center"
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="100%" />
</FrameLayout>
相关文章推荐
- RecyclerView设置间距
- SDK源
- android 图片文字轮播效果(图片和文字自动滚动)
- Android简单获取手机联系人姓名电话号码
- Android 欢迎界面的实现(带透明度动画)
- android 关于触摸事件的理解
- Android studio开发中,利用日志查看当前的activity
- 人脸识别face++ SDK demo体验
- Android 学习记录-获取天气API
- 基于Android的一个简易计算器的实现
- 实用的Android代码片段集合(精)
- Android中文文档
- Android中文API文档
- Android Studio 编译问题(1)
- 关于android数据库no such table错误的反思
- Android自定义View,单点触控小球,自定义Imageview圆形图片
- android Actionmode 样式自定义
- android imageView释放内存
- Android中AIDL的实现使用
- Android 文字自动滚动(跑马灯)效果的两种实现方法