-
Notifications
You must be signed in to change notification settings - Fork 38
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
RN 0.61.5 ScrollView 调用 scrollTo 方法报错: MJScrollViewManager.zoomToRect was called with 4 arguments but expects 3 arguments. #53
Comments
@bigggge 请问你引入库运行时正常?我直接报’ListView has been removed‘ |
我是把源码 copy 下来的,然后删了 ListView 相关的代码 |
RN 0.61.4 调用scrollToOffset有同样的问题。 |
@frankyLHJ 我修改了 RCTMJScrollViewManager.m , 就可以了,但不太清楚原理 加上
|
@bigggge 按你的添加了,但是还是会报错。 |
我按@bigggge的方法可行,其实就是把RCTScrollView里的copy过来,比对发现新增了scrollToOverflowEnabled、disableIntervalMomentum这两个,之前debug发现生成MJScrollViewManager方法的数组顺序和代码上是不一致的,自然和ScrollView也不一致,调scrollTo最终调到的其实是scrollToEnd,估计就是少了这两个属性的定义,所以整个顺序不对了,至于深层的原理也搞不明白,总之RCTScrollView有改动,最好也同步改动 |
@wenkangzhou 能看下你是怎么改的嘛?谢谢 |
我和@bigggge改法一样啊,他已经贴出来了 |
RN 0.61.5 使用 MJScrollView 时,调用 scrollTo scrollToOffset 等方法时报错
RN 0.59.10 使用 MJScrollView 正常
RN 0.61.5 使用自带的 ScrollView 正常
"MJScrollViewManager.zoomToRect was called with 4 arguments but expects 3 arguments. If you haven't changed this method yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away."
通过修改 react-native/Libraries/Components/ScrollResponder.js
发现方法调用错乱
调 scrollTo 会执行 zoomToRect
调 scrollToEnd 会执行 flashScrollIndicators
调 flashScrollIndicators 会执行 scrollToEnd
The text was updated successfully, but these errors were encountered: