我在recyclerView里面有一个NestedScrollView。我知道这不是一个好的实践,但我需要一个听众的卷轴。
侦听器包括当用户到达recyclerView的最终结果时通知。它有一个带有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>这就是我的应用程序的工作方式。

发布于 2018-02-19 17:57:31
试试这个..。recylerView.setNestedScrollingEnabled(false);在你的活动中..。编辑通知用户,如果他到达end..use
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy)
{
LinearLayoutManager layoutManager=LinearLayoutManager.class.cast(recyclerView.getLayoutManager());
int totalItemCount = layoutManager.getItemCount();
int lastVisible =
layoutManager.
findLastVisibleItemPosition(); boolean
endHasBeenReached
= lastVisible + 5
>= totalItemCount;
if (totalItemCount > 0 && endHasBeenReached)
{ //you have reached to the bottom of your recycler view } } });https://stackoverflow.com/questions/48871641
复制相似问题