【发布时间】:2013-08-04 10:48:55
【问题描述】:
大家好,我的问题有点难以解释,我会尽力解释..
之前我使用 detail.setIcon(R.drawable.ic_launcher);//之前 setIcon 只接受 int 值 但后来我不得不使用这个函数来设置图像 detail.setIcon(BitmapFactory.decodeByteArray(rawArt, 0, rawArt.length, bfo));这里我传递的值的类型已经改变......这里的“bfo”是位图类型。 这意味着我必须更改适配器中的值,我之前使用此行来设置图像 image.setImageResource(sng.icon);which accpets int 值,这意味着我将不得不改变“setImageResource”的东西来接受位图............any1可以帮我吗???
ImageView image = (ImageView) v.findViewById(R.id.icon);//this is the part of adapter
image.setImageResource(sng.icon);//this is the part of adapter
detail.setIcon(R.drawable.ic_launcher);
.......................
ImageView image = (ImageView) v.findViewById(R.id.icon);//this is the part of adapter
image.setImageResource(sng.icon);//this is the part of adapter which needs to be changed now
BitmapFactory.Options bfo=new BitmapFactory.Options();
detail.setIcon(BitmapFactory.decodeByteArray(rawArt, 0, rawArt.length, bfo));
另一种方法是我将位图解析为 int.....any1 知道我可以实现吗??
【问题讨论】:
标签: android imageview bitmapfactory custom-adapter