Recycler 视图在 imageview 内滚动,而 imageview 保持静止。我的要求是在滚动 recyclerview 时滚动两个视图。我编写的 xml 如下所示:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:gravity="center_vertical"
android:id="@+id/profileLayout"
android:layout_width="match_parent"
android:layout_height="180dp"
android:background="@color/primary_color"
android:orientation="vertical"
android:padding="10dp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/profile_image"
android:layout_width="96dp"
android:layout_height="96dp"
android:src="@drawable/profile_user"
app:border_color="#ffffff"
app:border_width="2dp" />
<TextView
android:id="@+id/fullNameTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/primary_color" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/drawerList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/myDrawerBackground"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
如何实现这种类型的滚动?