解决SDWebimage加载过多过大图片导致内存爆表崩溃的问题
- (void)imageLoadingSettings {
[SDImageCache sharedImageCache].config.maxCacheAge = 3600 * 24 * 7;
[SDImageCache sharedImageCache].maxMemoryCost = 1024 * 1024 * 20;
[SDImageCache sharedImageCache].config.shouldCacheImagesInMemory = NO;//是否缓存到内存中 默认是 YES
[SDImageCache sharedImageCache].config.shouldDecompressImages = NO;//是否解压图像 默认是 YES
[SDWebImageDownloader sharedDownloader].shouldDecompressImages = NO;
[SDImageCache sharedImageCache].config.diskCacheReadingOptions = NSDataReadingMappedIfSafe;
}
网友评论