我已经使用Picasso库来获取图像,但是当涉及到实现时,它什么也不会检索。您能告诉我处理JPG图像的期望规则吗?
override fun onBindViewHolder(holder: RecyclerView.ViewHolder , position: Int) {
if (holder is VHItem) {
val dataItem = getItem(position)
holder.title!!.text = dataItem.name
holder.desp!!.text = dataItem.district
val arrayImage = dataItem.images
if (arrayImage!!.isEmpty()) {
Picasso.get().load(R.drawable.home_11_20_storage).into(holder.parentView);
}
else{
val url = arrayImage[0]
println("image url : ${url}" )
Picasso.get().load(arrayImage[0]).resize(1800, 1800).centerInside().placeholder(R.drawable.home_11_20_storage)
.into(holder.parentView);
}
//cast holder to VHItem and set data
} else if (holder is VHHeader) {
//cast holder to VHHeader and set data for header.
}
}
I / System.out:图片网址:http://www.spacecentrestorage.com/assets/uploads/General/SCS-Slide02-Commercial.jpg