大家好,我的问题有点难以解释,我会尽力解释的。
早些时候,我使用的是detail.setIcon(R.drawable.ic_launcher);//earlier setIcon只接受int值,然后我不得不使用这个函数来设置图像detail.setIcon(BitmapFactory.decodeByteArray(rawArt,0、rawArt.length、bfo);在这里,我传递的值类型有changed...here "bfo“是位图类型。这意味着我必须更改适配器中的值,我之前使用了这一行来设置图像image.setImageResource(sng.icon);哪些表示值,这意味着我必须用指责bitmap.........can any1帮助我的东西来更改“setImageResource”?
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,知道我可以实现这一点吗??
发布于 2013-08-04 11:04:01
我搜索了一下,我发现我可以使用这个代码image.setImageBitmap(sng.icon)
而不是这个image.setImageResource(sng.icon)
https://stackoverflow.com/questions/18042104
复制相似问题