【发布时间】:2019-05-05 16:57:29
【问题描述】:
我在nestedScrollView android中有recycler view,如何在滚动nestedScrollView时获取recyclerview的当前item位置
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/constraintMain"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Linearlayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginBottom="5dp"
android:src="@drawable/logo" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view_all"
android:layout_width="match_parent"
android:nestedScrollingEnabled="false"
android:layout_height="wrap_content"
android:scrollbars="vertical" />
</Linearlayout>
</android.support.v4.widget.NestedScrollView>
有 addOnScrollListener 和 setOnScrollListener 函数 不使用 recyclerview 调用
【问题讨论】:
标签: android android-layout android-recyclerview android-nestedscrollview