2

いくつかのビューと RecyclerView を含む NestedScrollView があります。しかし、RecyclerView をスクロールすると、オーバースクロール効果が表示されるだけです。NestedScrollView で表示するにはどうすればよいですか?

RecyclerView を使用してオーバースクロール効果を無効にすることはできますが、RecyclerViewandroid:overScrollMode="never"のスクロール中に NestedScrollView でオーバースクロール効果を有効にする方法がわかりません。私はすでにすべての明白な解決策を試しました。

<androidx.core.widget.NestedScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <!-- My views here -->

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    </LinearLayout>

</androidx.core.widget.NestedScrollView>

gif

PS: RecyclerView アダプタが不必要に複雑になるため、いくつかのビューを RecyclerView の外に配置する必要があります (すべてのタイプの要素を記述する必要があります)。これがパフォーマンスに悪いとは言わないでください。私の場合、これは無関係です。

4

1 に答える 1