假设是这样的
形象词
但现在变成了这样
图片
单词
开始时图像和单词堆叠在一起,当我滑动列表视图时,它只会更改为
形象词
这是 baseadapter 中的 getview
public View getView(int position, View convertView, ViewGroup parent) {
View vi = convertView;
if (convertView == null)
vi = inflater.inflate(R.layout.main_alllatestnewslist, parent,
false);
ImageView imageview = (ImageView) vi
.findViewById(R.id.image_alllatestnewstitle);
imageview.setVisibility(View.INVISIBLE);
TextView titletext = (TextView) vi
.findViewById(R.id.text_particularlatestnewstitle);
if (!imagepath[position].toString().equals("no picture")) {
titletext.setPadding(imageview.getWidth() + 5, 0, 0, 0);
imageview.setVisibility(View.VISIBLE);
imageLoader.DisplayImage(imagepath[position], imageview);
} else {
imageview.setVisibility(View.INVISIBLE);
imageview.setImageDrawable(null);
titletext.setPadding(0, 0, 0, 0);
}
titletext.setText(title[position].toString());
return vi;
}
如何先检查然后设置仅填充显示?