假设是那样的
图片字
但现在变得像那样
图像
字
图像和文字堆叠在一起开始时,当我滑动列表视图时,它只会变为
图片字
这是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;
}
如何先检查然后设置仅填充显示?
答案 0 :(得分:0)
if(position == 0){
// enter code here
}
else{
//enter code here
}