首页 > 其他 > 详细

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

时间:2018-03-17 14:39:17      阅读:688      评论:0      收藏:0      [点我收藏+]

代码改变世界

错误:

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

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

原文:https://www.cnblogs.com/shmilyGWT/p/8589470.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!