Kotlin

 
  
API level 26

报错信息:
Type inference failed: Not enough information to infer parameter T in fun findViewById(p0: Int): T! Please specify it explicitly.

解决方案:
var iv_photo: ImageView = findViewById(R.id.iv_photo) as ImageView改为:
 
  
var iv_photo: ImageView = findViewById(R.id.iv_photo)

var iv_photo: ImageView = itemView?.findViewById(R.id.iv_photo) as ImageView改为:
var iv_photo: ImageView = itemView?.findViewById(R.id.iv_photo) as ImageView

你可能感兴趣的:(Android相关)