Recyclerview changing items when is scrolled

后端 未结 6 778
一个人的身影
一个人的身影 2021-02-09 17:57

Can someone explain to me, what the problem is?

When I scroll down and then back to the top, my items were changed for other items in the list, and if I scroll again, th

6条回答
  •  独厮守ぢ
    2021-02-09 18:33

    Just put you recylerView in a NestedScroll View in your xml and add the property nestedScrollingEnabled = false.

    And on your adapter onBindViewHolder add this line

    final AcademicVH viewHolder = (AcademicVH)holder;

    Use this viewHolder object with your views to setText or do any kind of Click events.

    e.g viewHolder.txtSubject.setText("Example");

提交回复
热议问题