0
我有一個30行數據的RecyclerView。一些行有我得到的圖像,並顯示與畢加索。 問題是,即使那行沒有圖像,圖像框每8行重複一次。 我檢查,如果圖像是空的不要顯示它,但顯示它呢。Android RecyclerView顯示數據甚至不存在
JobAdapter.java
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
final MyHolder myHolder = (MyHolder) holder;
JobClass current=data.get(position);
myHolder.name.setText(current.title);
myHolder.manager.setText(current.manager);
String phone= (String) new KerashDao(context).JobinfoGetValue(current.job_id.toString(),new KerashDao(context).SettingGetValue("phone").toString());
myHolder.phonecall.setText(phone.toString());
try {
if(!current.image.isEmpty()) {
Picasso.with(context)
.load(current.image)
.placeholder(R.drawable.icn_loading)
.into(myHolder.picture, new Callback() {
@Override
public void onSuccess() {myHolder.picture.setVisibility(View.VISIBLE);}
@Override
public void onError() {
myHolder.picture.setVisibility(View.GONE);
}
});
}
}catch (Exception ex){Log.i("JobAdapter2",ex.getMessage().toString()+"");}
}
即使在滾動後,它是否永久保留? – Redman
@Redman。是的,它每8行重複一次。我用'is_empty','equal(「」)'檢查圖像字段。 –
這是什麼設備,它如此之大? – Redman