您的位置:首页 > 移动开发 > Android开发

android 布局的性能优化

2015-07-02 18:19 465 查看

1、布局重用<include />

2、减少视图层级<merge />

3、需要时使用<ViewStub />

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/traffic_layout_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal" >

<include layout="@layout/traffic_layout_title" />

<include layout="@layout/traffic_layout_pull_result" />

<include layout="@layout/traffic_layout_pull" />
如上用法。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: