Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

滑动到底部,并执行adapter.notifyItemChanged(position)会自动往上滚动一段距离 #3841

Open
yingmiaohuangg opened this issue Jan 8, 2024 · 2 comments

Comments

@yingmiaohuangg
Copy link

我现在用的的4.1.4
只要滑动到底部,并执行adapter.notifyItemChanged(position)会自动往上滚动一段距离。
可能跟ConstraintLayout有关
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:clipToPadding="false"
android:paddingHorizontal="16dp"
android:paddingTop="6dp"
android:paddingBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ly_header"
app:layout_constraintBottom_toTopOf="@+id/ly_footer" />

当我把paddingBottom改成15dp就能解决该问题

Originally posted by @yingmiaohuangg in #3756 (comment)

@limuyang2
Copy link
Collaborator

和库无关

@neo-turak
Copy link

hasFixedSize 后试一下,RV内部重新计算View宽高,如果跟原来的不一样会往上滚动。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants