0
我想使用SimpleAdapter,并且不想覆盖Adapter。它是通过编写ListView布局文件实现的,并让图像在上传后显示圆边。我找到了一些参考,并像这样编写代码。我不明白如何传递参数。任何人的正确方向是感恩。Android-如何在列表视图中显示图像圆边缘
adapter.setViewBinder(new ViewBinder() {
public boolean setViewValue(View view, Object data,
String textRepresentation) {
if(view instanceof ImageView && data instanceof Bitmap){
ImageView iv = (ImageView) view;
iv.setImageBitmap((Bitmap) data);
return true;
}else
return false;
}
});
非常感谢,但如何使用XML文件上传图片? –
将其另存为可拉伸文件夹内的xml。并将您的imageview的背景设置为R.drawable.your_xml_file – san