Kotlin-Not enough information to infer parameter T in fun<T:View> findViewById(id: Int): T!

代码改变世界

错误:

Type inference failed : Not enough information to infer parameter T in fun<T:View> findViewById(id: Int): T! Please specify it explicitly.

 

解决:

 

holder.btnInstall = convertView.findViewById(R.id.btn_install) as Button  

  


改为

 

holder.btnInstall = convertView.findViewById<Button>(R.id.btn_install)  

  

 

转自:http://blog.csdn.net/myfwjy/article/details/78228829

posted @ 2018-03-17 14:04  改变世界的老十七  阅读(2027)  评论(0编辑  收藏  举报