【发布时间】:2018-02-19 17:52:15
【问题描述】:
我在 NestedScrollView 中有一个 recyclerView。我知道这不是一个好习惯,但我需要一个监听器来监听滚动。
当用户到达recyclerView的最后时,监听器包含在notify上。这有一个带有 3 个网格的 gridLayoutManager,可见的行数取决于屏幕的大小。
除了smoothScroll,一切正常。
<android.support.v4.widget.NestedScrollView
android:id="@+id/nestedGalleryAll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<android.support.v7.widget.RecyclerView
android:id="@+id/galleryAll"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.v4.widget.NestedScrollView>
这就是我的应用程序的工作方式。
【问题讨论】:
-
你到底想要什么??平滑滚动??
-
是的,只有smoothScroll不会丢失nestedScrollView的监听器
-
我已经更新了我的答案..
-
顺便说一句,为什么你需要嵌套滚动视图的监听器??
标签: android android-recyclerview smooth-scrolling android-nestedscrollview nestedscrollview