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

您好,最新的1.2.0版本有个Bug #70

Open
ansen666 opened this issue Apr 18, 2020 · 7 comments
Open

您好,最新的1.2.0版本有个Bug #70

ansen666 opened this issue Apr 18, 2020 · 7 comments

Comments

@ansen666
Copy link

ansen666 commented Apr 18, 2020

private int getWillPickIndexByGlobalY(int globalY) { if (mItemHeight == 0) return 0; int willPickIndex = globalY / mItemHeight + mShownCount / 2; int index = getIndexByRawIndex(willPickIndex, getOneRecycleSize(), mWrapSelectorWheel && mWrapSelectorWheelCheck); if (0 <= index && index < getOneRecycleSize()) { return index + mMinShowIndex; } else { throw new IllegalArgumentException("getWillPickIndexByGlobalY illegal index : " + index + " getOneRecycleSize() : " + getOneRecycleSize() + " mWrapSelectorWheel : " + mWrapSelectorWheel); } }

以上这个方法会抛出异常,NumberPickerView.getWillPickIndexByGlobalY方法,麻烦处理一下

@ansen666
Copy link
Author

异常日志:java.lang.IllegalArgumentException: getWillPickIndexByGlobalY illegal index : -16 getOneRecycleSize() : 12 mWrapSelectorWheel : false

@Carbs0126
Copy link
Owner

是不是在滑动过程中,设置displayvalue了?如果设置的displayvalue的数组长度比之前短,并且没有重新设置maxvalue时,会出现类型情况

@HolenZhou

This comment was marked as resolved.

@ansen666
Copy link
Author

我也一直没找到问题,自己测试都好好的,但是umeng上就一直有统计这个错误

@HolenZhou
Copy link

我也一直没找到问题,自己测试都好好的,但是umeng上就一直有统计这个错误

一样的情况,我看有三个issue都是这样的问题,应该不是使用方法错误吧

@Aidenat9
Copy link

老版本就存在这个错误 ,我用的1.1.1,也是偶尔报这个,不过量不大。

@Carbs0126
Copy link
Owner

抱歉给大家带来麻烦了。
最近比较忙,没太多精力关注这个事情,我目前猜测:

  1. 可能和数据有变化有关?比如考虑synchronized

  2. 报的问题是不是在调试阶段产生的?

可以把代码下载下来,然后把这几个throw 删除掉,规避一下崩溃

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

4 participants