您好我正在测试我创建的应用程序,有点像Instagram。我使用滑动作为图像加载器,但我在大约4-5张图像中快速增加100加ram使用,我在400 x 400 imageview中使用保存DiskCacheStrategy.ALL,如何避免使用过多的ram以及如何使用大型应用程序 - Instagram,facebook进行内存管理。
Glide.with(getContext())
.load(Uri.fromFile(file))
.placeholder(R.drawable.placeholder_media)
.error(R.drawable.placeholder_error_media)
.dontAnimate()
.diskCacheStrategy(DiskCacheStrategy.All)
.skipMemoryCache( true )
.override(400, 400)
.centerCrop()
.into(mMediaThumb
答案 0 :(得分:0)
您可以按照以下链接https://futurestud.io/tutorials/glide-module-example-optimizing-by-loading-images-in-custom-sizes中的教程来请求特定尺寸的图片,这样就不会有大的负载