android Merger 代替 FrameLayout:布局优化
2016-06-24 22:12
453 查看
<?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.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="80dp"/> <include layout="@layout/view_toolbar_with_indicator"/> </FrameLayout> 图1 的布局
<merge xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="?actionBarSize"/> <include layout="@layout/view_toolbar_with_indicator"/> </merge> 图2的布局
merge比framelayout的少一个framelayout的节点
相关文章推荐
- Android 查看内存使用工具 (procstats)
- Android 基于SurfaceTexture shader的类动漫+波浪形图像处理
- android Context深度剖析
- 详解Android中AsyncTask的使用
- Andorid与其他操作系统的知识
- Android绘图基础之: Canvas 和 Paint
- AsyncTask
- 如何获取注册高德Key使用的SHA1值与包名?
- Android Parcelable的写法
- 移动混合开发之android文件管理-->flexbox,webFont。
- Android二维码扫描开发(一):实现思路与原理
- Android初级教程理论知识(第十章Fragment与动画)
- Android初级教程理论知识(第十章Fragment与动画)
- Android-2016后半年的学习计划
- android中的service与Activity之间的通信
- Android Studio中获取sha1证书指纹
- 通过sdk工具 aapt.exe 获取apk的信息
- Android学习推荐!
- Android常用的一些make命令
- android Studio导入aar