1
A
回答
1
public Onadapter(Context context,String[] id,String[] label,String[] title,String[] image,String[] hrs,String[] posted_date)
{
this.context=context;
this.id = id;
this.label = label;
this.title = title;
this.image = image;
this.hrs = hrs;
this.posted_date=posted_date;
}
private class ViewHolder{
ImageView img;
TextView id;
TextView label;
TextView title;
TextView hrs;
TextView posted_date;
}
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
if (convertView == null) {
convertView = mInflater.inflate(R.layout.whatslist, null);
holder = new ViewHolder();
holder.id=(TextView) convertView.findViewById(R.id.whats_id);
holder.img = (ImageView) convertView.findViewById(R.id.thumb1);
holder.label= (TextView) convertView.findViewById(R.id.label);
holder.title = (TextView) convertView.findViewById(R.id.artist_e_desc);
holder.hrs = (TextView) convertView.findViewById(R.id.hrs);
holder.posted_date = (TextView) convertView.findViewById(R.id.date);
convertView.setTag(holder);
}
else {
holder = (ViewHolder) convertView.getTag();
}
holder.id.setText(id[position]);
holder.label.setText(label[position]);
holder.title.setText(title[position]);
holder.hrs.setText(hrs[position]);
holder.posted_date.setText(posted_date[position]);
imgaq = new AQuery(convertView);
imgaq.id(holder.img).image(image[position], true, true, 0, 0, null, AQuery.FADE_IN_NETWORK, 1.0f);
return convertView;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return image.length;
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return null;
}
}
相關問題
- 1. 使用通用圖像加載器在列表視圖中加載圖像
- 2. 在列表視圖中加載圖像
- 3. 在列表視圖中加載圖像
- 4. 使用片段列表視圖
- 5. C# - 將圖像加載到圖像列表和列表視圖
- 6. 使用aframe加載圖片
- 7. 使用jQuery加載圖片?
- 8. 加載圖片到列表框
- 9. 圖片庫使用表格視圖
- 10. 使用'presentModalViewController'加載視圖
- 11. 加載列表視圖中的動畫
- 12. 列表視圖不應該加載onBackPressed
- 13. GTK惰性加載列表視圖#
- 14. 滾動列表視圖加載(Android)
- 15. 加載HTML在列表視圖項onclick
- 16. 加載列表到Datagrid視圖C#
- 17. Android - 懶加載列表視圖
- 18. 加載圖片
- 19. 圖片列表使用
- 20. 可點擊圖片列表視圖
- 21. 列表視圖顯示圖片
- 22. 圖片列表視圖適配器
- 23. 誤差圖像列表視圖片段
- 24. 爲列表視圖緩存圖片
- 25. 水平列表視圖從URL加載相同的圖像(使用畢加索)
- 26. 將圖片添加到圖片箱中的圖片列表
- 27. 錯誤的圖像加載時在列表視圖中加載圖像
- 28. 添加視圖中列表視圖
- 29. 圖片加載時加載圖標
- 30. 畢加索圖像重新加載滾動在列表視圖