【发布时间】:2020-09-19 16:40:30
【问题描述】:
我将创建一个复杂/正常的设计,它有一个空屏幕布局和微光布局。
我的问题是在一个布局中包含多个 <include> 文件比做两个片段并不断替换它们要好。
更多细节:
1- 使数据屏幕显示和空白屏幕隐藏如下:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/common_toolbar" />
<include layout="@layout/empty_layout"/>
// my data layout
</LinearLayout>
2- 创建一个FrameLayout 并不断更改具有多个fragments 的不同屏幕的容器:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
我需要了解取决于多个视图的slow rendering 的最佳做法。
另一个问题,that 是否包含在显示/隐藏视图中,或者它仅取决于显示的视图,因为我感到困惑 并且需要应用最佳实践。
【问题讨论】:
标签: android performance android-layout android-fragments