Kotlin-Not enough information to infer parameter T in fun 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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM