Overload Resolution Ambiguity error in kotlin

前端 未结 5 518

How do I fix this Overload error, I have Overload Resolution Ambiguity error, I sync it in my project and clean it and rebuild it but it\'s get me bellow error ,I add main

5条回答
  •  遥遥无期
    2021-01-01 09:15

    Referencing this answer, you can specifically import the ID you want and name it using Kotlin's as keyword

    package XXX
    
    import kotlinx.android.synthetic.main.num_info_inet_plus_pack.view.circle as inetViewCircle
    import kotlinx.android.synthetic.main.num_info_pack.view as circle
    //...
    val inetView = activity.layoutInflater.inflate(R.layout.num_info_pack, parent, false)
    inetViewCircle.setBackgroundResource(background)
    

提交回复
热议问题