我只是想知道如何设计如下图所示的活动。当您选择在 Google Play 中查看应用程序详细信息时,也会发现此模式。
我们是否使用 ViewPager 进行这种设计?
示例链接,教程将不胜感激。
我只是想知道如何设计如下图所示的活动。当您选择在 Google Play 中查看应用程序详细信息时,也会发现此模式。
我们是否使用 ViewPager 进行这种设计?
示例链接,教程将不胜感激。
我不确定这是否是一种有效的做法。我更喜欢完全使用线性布局。
<!-- parent layout -->
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<!-- splitting into 2 horizontal -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<!-- 1st part of horizontal -->
<LinearLayout
android:layout_width="x_value"
android:layout_height="match_parent"
android:orientation="vertical"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical"
android:layout_weight="1">
<!-- include content -->
</ScrollView>
</LinearLayout>
<!-- 2nd part of horizontal -->
<LinearLayout
android:layout_width="x_value"
android:layout_height="match_parent"
android:orientation="vertical"
>
<!-- fixed header part-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="y_value"
>
</LinearLayout>
<!-- next 2 vertical splits with scrollbar-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="y_value"
android:orientation="vertical"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="y_value"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="horizontal"
android:layout_weight="1">
<!-- include content -->
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="y_value"
>
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
I hope this would give some idea.