Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants