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

加载 RecyclerView 莫名自动滚动,注册监听发现 newState == 2,不是手动滑动 #225

Closed
yuri8080 opened this issue Oct 20, 2017 · 8 comments

Comments

@yuri8080
Copy link

@yuri8080 yuri8080 commented Oct 20, 2017

我加载一个页面(acticity)的时候,整体都用 RecyclerView 来实现, 然后进入这个acticity 的时候,会自动发生 滚动事件 !!

我绝对没有 进行任何滚动操作 (诸如,smoothScrollToPosition,scrollToPosition,scrollTo 都没有,甚至连 scroll 关键字都没有) ,但是 RecyclerView ,依然会发生自动滚动 !! 请大神 看看,是不是 bug ,如果,不是 希望给予指导 !!! 拜谢 拜谢!!

@yuri8080

This comment has been minimized.

Copy link
Author

@yuri8080 yuri8080 commented Oct 20, 2017

补充一下, 我用的是 VirtualLayoutManager layoutManager = new
VirtualLayoutManager(getApplication());

final List<DelegateAdapter.Adapter> listItems = new LinkedList<>();
listItems.add.......

@yuri8080

This comment has been minimized.

Copy link
Author

@yuri8080 yuri8080 commented Oct 20, 2017

继续 自己补充 ! 解决方法

android:descendantFocusability="blocksDescendants" 父布局里,加这句

android:overScrollMode="never" recycleView里加这局

PS 这是我往后面翻问题,看的的一个大神的回答 ! 多谢那位,大神

@longerian

This comment has been minimized.

Copy link
Contributor

@longerian longerian commented Oct 21, 2017

ok 这个应该是某个view获取焦点,触发重新布局引起的偏移。

@iielse

This comment has been minimized.

Copy link

@iielse iielse commented Oct 23, 2017

可以,我倒是遇到了 recyclerView嵌套 recyclerView导致的自动滑动

@SubinVane

This comment has been minimized.

Copy link

@SubinVane SubinVane commented Dec 21, 2017

http://www.jianshu.com/p/cb4fc4f01cf9 使用VLayout,你可能遇到的问题

@longerian

This comment has been minimized.

Copy link
Contributor

@longerian longerian commented Jan 16, 2018

@yuri8080 我最近修复了一个 bug,重新进入页面,如果触发重布局(如果有padding margin之类的设置)会引起滚动、偏移。 你可以试试新版本。

@longerian longerian closed this Jan 16, 2018
@yuri8080

This comment has been minimized.

Copy link
Author

@yuri8080 yuri8080 commented Jan 16, 2018

好的,多谢大神通知 @longerian

@MagicKim

This comment has been minimized.

Copy link

@MagicKim MagicKim commented Nov 8, 2019

@ yuri8080我最近修复了一个bug,重新进入页面,如果触发重布局(如果有padding margin之类的设置)会引起滚动,替换。你可以试试新版本。

大佬可否告知,recyclerView如果触发重布局(如果有padding margin之类的设置)会引起滚动.这个源码在layoutmanager里面还是recyclerView里面?我想分析一下,目前我也遇到了这个问题.看到您说的才解决了.@longerian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.