【发布时间】:2014-09-03 07:10:08
【问题描述】:
我在我的应用中使用通用图像下载器,配置如下 -
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
.memoryCacheExtraOptions(1000, 1200)
.threadPoolSize(4)
.threadPriority(Thread.MIN_PRIORITY + 2)
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(1024*1024*5)) // You can pass your own memory cache implementation
.discCacheFileNameGenerator(new HashCodeFileNameGenerator())
.defaultDisplayImageOptions(DisplayImageOptions.createSimple())
.build();
ImageLoader.getInstance().init(config);
现在我想在列表中显示的图像可以是任何大小的图像,可能是高分辨率的图像或分辨率较低的图像,但我想显示宽度 = 设备宽度和高度 = 固定高度的图像,例如 300dp,没有模糊或拉伸图片。 是否可以创建这种视图。Instagram 正在使用此过程。见下图-
【问题讨论】:
-
您可能想要创建自己的图像视图并覆盖 onmeasure 方法。这将是最简单的解决方案。
-
感谢您的回答,我明白了,请您解释一下我该怎么做。
-
是此设置需要大内存的问题,还是您只是在问如何将图像拉伸到屏幕尺寸?如果是后者,那么这不是与 UID 相关的问题
标签: android image bitmap image-resizing universal-image-loader