【发布时间】:2013-09-23 18:09:47
【问题描述】:
我在资产文件夹中有一个要显示的位图图像列表(使用 ViewPager)。我尝试根据屏幕尺寸(使用布局参数)设置图像的宽度和高度。但是图像质量会受到干扰。如何让画质更好?
Drawable drw = Drawable.createFromStream(getAssets().
open("Parts/"+drawables[i]),null);
这里,drawables[i] 是 String[](比如 ball.bmp 和“Parts”是资产的子文件夹)。
现在,我已将 imageview 中的图像设置为,
imageView.setBackgroundDrawable(imageArray[position]);
图片在移动设备上看起来不错,但在标签中看起来被拉伸了。
【问题讨论】:
-
你应该用新的宽度和高度转换你的位图对象
标签: android android-imageview bitmapimage