【问题标题】:Overload resolution ambiguity. All these functions match. In Picasso (into) function重载分辨率歧义。所有这些功能都匹配。在毕加索(入)功能
【发布时间】:2021-02-22 08:59:50
【问题描述】:

我陷入了毕加索所谓的开放式趣味方法之一。

我在我的 recyclerview 中使用 URL 来获取图像。我不认为这是recyclerview的问题。我认为它更可能是一个错误。

override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
      Picasso.get().load(arrayPlaces[position].url).into(holder.itemView.findViewById(R.id.mainImage))
    }

对于我尝试过的解决方案:

This

This

This

GitHub: https://github.com/sophin123/RecyclerViewwithImages

【问题讨论】:

    标签: android android-studio android-recyclerview picasso


    【解决方案1】:

    通过在f​​indViewById中添加ImageView解决了()

       override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
          Picasso.get().load(arrayPlaces[position].url).into(holder.itemView.findViewById<ImageView>(R.id.mainImage))
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-13
      • 2014-03-11
      相关资源
      最近更新 更多