大佬教程收集整理的这篇文章主要介绍了android – 错误的图像显示在我的ListView行中,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@Override public View getView(int position,View convertView,ViewGroup parent) { View v = convertView; if (v == null) { LayoutInflater vi = (LayoutInflater) getSystemservice(Context.LAYOUT_INFLATER_serviCE); v = vi.inflate(R.layout.listrow,null); } Order o = items.get(position); if (o != null) { TextView tt = (TextView) v.findViewById(R.id.toptext); ImageView thumb = (ImageView) v.findViewById(R.id.icon); if (o.getOrderDrawable() != null) { thumb.setImageDrawable(o.getOrderDrawable()); } else { tt.setText(o.getOrdertitle()); } } return v; }
问题是滚动时;有时会显示正确的图像,但有时向后/向前滚动时,图像会随机显示,并且与行无关.
图像从网上下载.
我该如何解决这个问题?
以上是大佬教程为你收集整理的android – 错误的图像显示在我的ListView行中全部内容,希望文章能够帮你解决android – 错误的图像显示在我的ListView行中所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。