[教程]安卓ListView显示位图代码

2014-04-23 21:31:35 -0400
//配置适配器,以实现往hashmap放bitmap
sa.setViewBinder(new ViewBinder(){
public boolean setViewValue(View view, Object data, String str)
{
if (view instanceof ImageView && data instanceof Bitmap)
{
ImageView iv = (ImageView) view;
iv.setImageBitmap((Bitmap) data);
return true;
}
else
return false;
}
}
);
注:其中sa为SimpleAdapter对象
«Newer      Older»
Comment:
Name:

Back to home

Subscribe | Register | Login | N