美文网首页
android NestedScrollView里嵌套Recyc

android NestedScrollView里嵌套Recyc

作者: hao_developer | 来源:发表于2020-11-28 17:20 被阅读0次

布局

<androidx.core.widget.NestedScrollView
   android:id="@+id/scroView"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   app:layout_anchorGravity="bottom"
   app:layout_behavior="@string/appbar_scrolling_view_behavior">

   <androidx.recyclerview.widget.RecyclerView
           android:id="@+id/rvList"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:nestedScrollingEnabled="false"
            android:overScrollMode="never" />

</androidx.core.widget.NestedScrollView>

解决方案

scroView.fling(0)
scroView.smoothScrollTo(0,0)

相关文章

网友评论

      本文标题:android NestedScrollView里嵌套Recyc

      本文链接:https://www.haomeiwen.com/subject/qjhcwktx.html