pinguo-zhouwei / MZBannerView

仿魅族BannerView,图片轮播控件,支持多种模式切换:普通ViewPager使用,普通Banner使用,仿魅族Banner使用。
2.31k stars 421 forks source link

在kotlin中使用报了这样的错 #88

Open clbDream opened 6 years ago

clbDream commented 6 years ago

Out-projected type 'MZBannerView<>!' prohibits the use of 'public open fun setPages(datas: (Mutable)List<T!>!, mzHolderCreator: MZHolderCreator<(raw) MZViewHolder<>!>!): Unit defined in com.zhouwei.mzbanner.MZBannerView'

clbDream commented 6 years ago

banner.setPages(listBean, MZHolderCreator<BannerViewHolder> { BannerViewHolder() })

davidtps commented 6 years ago

同问~ 楼主解决了么 #80 已解决

Fish-Bin commented 5 years ago

这个问题是因为kotlin里面不能识别泛型T,重写MZBannerView,带上泛型就可以了