nice-spinner icon indicating copy to clipboard operation
nice-spinner copied to clipboard

当数据为1时产生的一个BUG

Open lulianqing opened this issue 5 years ago • 5 comments

调用 nicespinner.attachDataSource(list),当list.size()=1时,nicespinner不会显示任何string

lulianqing avatar Aug 30 '19 06:08 lulianqing

可以通过手动调用setSelectedIndex这个方法来解决,但是这样操作的前提是你的list只能是String,如果是对象的话,这个方法会报类型转换异常。说到底还是库有问题

jordan32331 avatar Sep 03 '19 09:09 jordan32331

@arcadefire Can you help solve this bug?

kcjian avatar Sep 04 '19 07:09 kcjian

@arcadefire Can you help solve this bug?

只能添加一个一模一样的数据了

wyba avatar Sep 05 '19 08:09 wyba

@arcadefire Can you help solve this bug?

只能添加一个一模一样的数据了

我下载了源码改了一下,NiceSpinner.setAdapterInternal方法里的 if (adapter.getCount() > 0) 改为 if (adapter.getCount() >= 0)就没问题了,依赖本地代码了

kcjian avatar Sep 05 '19 08:09 kcjian

setAdapterInternal

学习到了,大神^_^,哈哈哈

wyba avatar Sep 05 '19 08:09 wyba