图片未更改毕加索

时间:2019-01-08 14:34:41

标签: android-studio picasso

我正在使用recyclerview通过Picasso更改img,但图像未更改。 我的适配器

@Override
public void onBindViewHolder(EmployeeViewHolder holder, int position) {
    Context context = holder.imgCover.getContext();
    holder.txtEmpName.setText(dataList.get(position).getName());
    holder.txtEmpEmail.setText(dataList.get(position).getEmail());
    holder.txtEmpPhone.setText(dataList.get(position).getPhone());
    String replacedString = dataList.get(position).getGambar().replace("kk2019", "/");
    Picasso.get().load("https://myurl.com/images.jpg").into(holder.imgCover);

}

然后

class EmployeeViewHolder extends RecyclerView.ViewHolder {

    TextView txtEmpName, txtEmpEmail, txtEmpPhone;
    ImageView imgCover;
    EmployeeViewHolder(View itemView) {
        super(itemView);
        txtEmpName = (TextView) itemView.findViewById(R.id.txt_employee_name);
        txtEmpEmail = (TextView) itemView.findViewById(R.id.txt_employee_email);
        txtEmpPhone = (TextView) itemView.findViewById(R.id.txt_employee_phone);
        imgCover = (ImageView) itemView.findViewById(R.id.img_cover);
    }
}

0 个答案:

没有答案