比文艺式更好的方式?
关于BaseAdapter的文艺模式,直接修改为下面的方式,可以吗?
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
if (view == null) {
view = inflater.inflate(R.layout.news_item, null);
NewsBean bean = list.get(i);
ImageView imageView = (ImageView) view.findViewById(R.id.iv_news);
ImageLoader imageLoader = new ImageLoader(imageView, bean.IconUrl);
imageLoader.showImageByThread();//异步加载图片
TextView txtTitle = (TextView) view.findViewById(R.id.tv_news_title);
txtTitle.setText(bean.Title);
TextView txtContent = (TextView) view.findViewById(R.id.tv_news_content);
txtContent.setText(bean.Content);
}
return view;
}这样也不会出现错乱,也不会重复的设置图片和文本。
请教下老师,这样会有什么问题吗?