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

list列表数据count为1时,pop不弹出(版本1.4.5) #175

Open
tbg1234567890 opened this issue Nov 21, 2020 · 1 comment
Open

list列表数据count为1时,pop不弹出(版本1.4.5) #175

tbg1234567890 opened this issue Nov 21, 2020 · 1 comment

Comments

@tbg1234567890
Copy link

tbg1234567890 commented Nov 21, 2020

经查看源码NiceSpinner发现:
1、在设置adapter的方法setAdapterInternal中,在1.4.5之前设置条件为adapter.getCount() > 0,现作者已改为adapter.getCount() > =0。
2、在方法onTouchEvent中,弹出条件仍为adapter.getCount() > 0,而NiceSpinnerAdapter的getCount会数据长度上减1,最终造成条件不成立,从而不弹窗

@op123355569
Copy link

经查看源码NiceSpinner发现:
1、在设置adapter的方法setAdapterInternal中,在1.4.5之前设置条件为adapter.getCount() > 0,现作者已改为adapter.getCount() > =0。
2、在方法onTouchEvent中,弹出条件仍为adapter.getCount() > 0,而NiceSpinnerAdapter的getCount会数据长度上减1,最终造成条件不成立,从而不弹窗

理论上就是不弹窗的吧,弹窗列表会把选中项剔除,所以,只有一项的时候,并无带选项,所以应该无弹窗,就算有也是空的。

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

2 participants