1
我已經剪掉了這段代碼。它是一個水平列表視圖。問題是相同的圖像被加載而不是不同的圖像。可能是什麼問題?我認爲畢加索不是這裏的問題。我猜它是別的。水平列表視圖從URL加載相同的圖像(使用畢加索)
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
// View timeLineRow = LayoutInflater.from(parent.getContext()).inflate(R.layout.dashboardtimelinerow, null);
if (convertView == null) {
LayoutInflater mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = mInflater.inflate(R.layout.toprecommendationsitem, parent, false);
holder = new ViewHolder();
holder.recommimage = (ImageView) convertView.findViewById(R.id.recommimage);
holder.userImage = (CircularImageView) convertView.findViewById(R.id.userImage);
convertView.setTag(holder);
} else
holder = (ViewHolder) convertView.getTag();
int i=0;
for(i=0; i<mArrayListData.size(); i++) {
if (!mArrayListData.get(i).getDishimageurl().isEmpty()) {
Picasso.with(mContext)
.load(mArrayListData.get(i).getDishimageurl())
.resize(172, 172)
.into(holder.recommimage);
break;
}
}
return convertView;
}