完美解决(看涂鸦部分)
Map<Integer,View>map=new HashMap<>();
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ZanRanking data = list.get(position);
ViewHolder holder = null;
if (map.get(position) == null) {
convertView = LayoutInflater.from(context).inflate(
R.layout.fargment_fengyun_rangking_lv_item, null);
holder = new ViewHolder();
holder.tv_name = (TextView) convertView
.findViewById(R.id.tv_name);
holder.iv_pic = (ResizableImageView) convertView
.findViewById(R.id.iv_pic);
holder.tv_count = (TextView) convertView
.findViewById(R.id.tv_count);
holder.tv_ranking = (TextView) convertView
.findViewById(R.id.tv_ranking);
holder.iv_dianzan_pic = (ImageView) convertView
.findViewById(R.id.iv_dianzan_pic);
holder.tv_level = (TextView) convertView
.findViewById(R.id.tv_level);
holder.tv_power = (TextView) convertView.findViewById(R.id.tv_power);
holder.tv = (TextView) convertView.findViewById(R.id.tv);
map.put(position,convertView);
convertView.setTag(holder);
} else {
convertView=map.get(position);
holder = (ViewHolder) convertView.getTag();
}
if (!(list.get(position).getPraiseme()).equals("0") ) {
holder.iv_dianzan_pic.setImageResource(R.drawable.dianzhihou);
}
本文永久地址:http://blog.it985.com/15851.html
转载于:https://www.cnblogs.com/wangyahui/p/listview.html