我用得是Xutils 然后有的item有图片有的不显示,结果错位了
下面代码:
//图片url
public View getView(final int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
final ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = View.inflate(getApplicationContext(), R.layout.shequlistadaper, null);
holder.shequtupian1 = (ImageView) convertView.findViewById(R.id.shequtupian1);
holder.shequtupian2 =(ImageView) convertView.findViewById(R.id.shequtupian2);
holder.shequtupian3 = (ImageView) convertView.findViewById}
else {
holder = (ViewHolder) convertView.getTag();
}
//图片url
String p1 =tupian1.get(position).toString();
String p2 =tupian2.get(position).toString();
String p3 =tupian3.get(position).toString();
//加载图片
if(p1.equals("no")){
utils1.display(holder.shequtupian1, p1);
holder.shequtupian1.setVisibility(View.GONE);
}else{
holder.shequtupian1.setVisibility(View.VISIBLE);
utils1.display(holder.shequtupian1, p1);}