We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
上拉后,下拉到底部 上面有空白条
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
这时因为这里onNestedPreScroll处理下拉时,发生了scrollY越界,在showTop时,应当判断当前dy是否超过了scrollY的范围 以下是修复代码,我拿kt写的
onNestedPreScroll
override fun onNestedPreScroll(target: View, dx: Int, dy: Int, consumed: IntArray) { printStack() val hiddenTop = dy > 0 && scrollY < mTopViewHeight val showTop = dy < 0 && scrollY >= 0f && !target.canScrollVertically(-1) if (hiddenTop) { scrollBy(0, dy) consumed[1] = dy } if (showTop) { scrollBy(0, -min(scrollY, abs(dy))) consumed[1] = -min(scrollY, abs(dy)) } }
No branches or pull requests
上拉后,下拉到底部 上面有空白条
The text was updated successfully, but these errors were encountered: