使用androidx.core.widget.NestedScrollView包裹的内容能够实现整体的向上移动
注:NestedScrollView内部只能包裹一个子view,如果含有多个并列的子view会报错,这时可以将多个并列的子view再嵌套一层布局即可
<?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:background="@color/colorPageBg"
android:orientation="vertical">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="125dp"
android:layout_marginBottom="14dp">
<androidx.viewpager.widget.ViewPager
android:id="@+id/home_pager_looper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never" />
<LinearLayout
android:id="@+id/looper_point_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
</LinearLayout>
</RelativeLayout>
<!--标题-->
<include layout="@layout/include_home_pager_title_part" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/home_pager_content_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="11dp"
android:overScrollMode="never" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>