Android ScrollView和RecyclerView滑动冲突

布局中

 <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <androidx.recyclerview.widget.RecyclerView
                android:overScrollMode="never"
                android:scrollbars="none"
                android:id="@+id/recycler"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:nestedScrollingEnabled="false"/>
        </RelativeLayout>
    </ScrollView>

kotlin代码中

{
            override fun canScrollVertically(): Boolean {
                return false
            }
        }

猜你喜欢

转载自blog.csdn.net/weixin_43522997/article/details/107566153