MarqueeView
MarqueeView copied to clipboard
Kotlin无法使用,还是我写法有问题,该怎么修改?
Type mismatch.
Required:
(Nothing..List<Nothing!>?)
Found:
List<CustomModel>
Projected type MarqueeView<*>! restricts use of public open fun startWithList(messages: (Mutable)List<T!>!): Unit defined in com.sunfusheng.marqueeview.MarqueeView
(marqueeView as MarqueeView<String>).startWithList(messages) KT刚刚我遇到 想到一个办法就是类型不匹配需要强转一下
同求解决办法
(marqueeView as MarqueeView<String>).startWithList(messages) MarqueeView<T>要指定你的list数据类型,
这个我已经解决了,使用kotlin也是可以的我这有个例子 https://github.com/tractors/VLayout_Demo/blob/master/README.md 如果好用的话,不要忘了点个星