NestedScrollView位於RecyclerView中。當這個RecyclerView實例化一個addOnScrollListener時,監聽器可以正常工作,但是我不能做分頁,也不能正確地跟蹤屏幕上的RecyclerView項目。當RecyclerView不是NestedScrollView,一切正常NestedScrollView中的RecyclerView.addOnScrollListener
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp" />
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
澄清的措辭;修復語法。 – Prune