Android开发总结笔记 FrameLayout(帧布局) 1-1-3
2015-09-22 08:26
344 查看
FrameLayout的继承结构
帧布局的主要作用是,后面添加的组件会覆盖前面添加的组件。(FrameLayout
API)
帧布局中的xml属性
通常用法
效果图
现在加上android:foreground这个属性试试
==。好大,应该是framelayout高和宽都设置了match_parent的关系
下面再来看看加上android:foregroundGravity试试
嗯。这大小是正常点了。
FrameLayout总的用法还是比较简单的。就这么两个属性
其他
在关于FrameLayout的API文档中,前面部分有一个setConsiderGoneChildrenWhenMeasure()的方法
如果设置为true,在测量子组件的时候就会考虑把带有android:visibility一起测量,false则忽略,默认为false
帧布局的主要作用是,后面添加的组件会覆盖前面添加的组件。(FrameLayout
API)
帧布局中的xml属性
通常用法
<FrameLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="300dp"
android:layout_height="300dp"
android:background="@android:color/holo_blue_bright"/>
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:background="@android:color/holo_green_dark"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@android:color/holo_orange_dark"/>
</FrameLayout>
效果图
现在加上android:foreground这个属性试试
android:foreground="@mipmap/ic_launcher"
==。好大,应该是framelayout高和宽都设置了match_parent的关系
下面再来看看加上android:foregroundGravity试试
android:foregroundGravity="bottom"
嗯。这大小是正常点了。
FrameLayout总的用法还是比较简单的。就这么两个属性
其他
在关于FrameLayout的API文档中,前面部分有一个setConsiderGoneChildrenWhenMeasure()的方法
如果设置为true,在测量子组件的时候就会考虑把带有android:visibility一起测量,false则忽略,默认为false
相关文章推荐
- 半年之内拿下android
- android适配问题
- 源码分析Mms--AndroidManifest.xml分析
- android 画画
- 蜂窝教育Android培训:高薪等于开心吗?
- databinding学习(4)
- Getting Started: Configuring Mac for Android
- Android Activity生命周期详解
- AndroidStudio出现找不到JVM问题
- Android中Manifest的Application的name和getApplication()的关系
- Android studio中几个插件的使用
- Android Design Support Library 的 代码实验——几行代码,让你的 APP 变得花俏
- Android之JSON处理器FastJson
- Android之日期时间选择器使用方法
- [坑]android ListView 加载数据乱码
- Android获取手机及路由器的Mac地址和IP地址
- android 学习笔记1
- android ViewGroup的事件分发机制
- Bundle在Activity之间交换数据
- Android对话框实现