Commit 36abbfc3 authored by banchichen's avatar banchichen

解决6plus真机上内存占用高的问题

parent ddab42e8
Pod::Spec.new do |s|
s.name = "TZImagePickerController"
s.version = "1.4.2"
s.version = "1.4.3"
s.summary = "A clone of UIImagePickerController, support picking multiple photos、original photo and video"
s.homepage = "https://github.com/banchichen/TZImagePickerController"
s.license = "MIT"
s.author = { "banchichen" => "736420282@qq.com" }
s.platform = :ios
s.ios.deployment_target = "6.0"
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "1.4.2" }
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "1.4.3" }
s.requires_arc = true
s.resources = "TZImagePickerController/TZImagePickerController/*.{png,xib,nib,bundle}"
s.source_files = "TZImagePickerController/TZImagePickerController/*.{h,m}"
......
......@@ -27,7 +27,8 @@ static CGSize AssetGridThumbnailSize;
manager.cachingImageManager = [[PHCachingImageManager alloc] init];
manager.cachingImageManager.allowsCachingHighQualityImages = NO;
CGFloat scale = [UIScreen mainScreen].scale;
// 测试发现,如果scale在plus真机上取到3.0,内存会增大特别多。故这里写死成2.0
CGFloat scale = 2.0;
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
CGFloat margin = 4;
CGFloat itemWH = (screenWidth - 2 * margin - 4) / 4 - margin;
......@@ -320,7 +321,7 @@ static CGSize AssetGridThumbnailSize;
} else {
PHAsset *phAsset = (PHAsset *)asset;
CGFloat aspectRatio = phAsset.pixelWidth / (CGFloat)phAsset.pixelHeight;
CGFloat multiple = [UIScreen mainScreen].scale;
CGFloat multiple = 2.0;
CGFloat pixelWidth = photoWidth * multiple;
CGFloat pixelHeight = pixelWidth / aspectRatio;
imageSize = CGSizeMake(pixelWidth, pixelHeight);
......
......@@ -123,7 +123,7 @@ static CGSize AssetGridThumbnailSize;
[super viewWillAppear:animated];
[self scrollCollectionViewToBottom];
// Determine the size of the thumbnails to request from the PHCachingImageManager
CGFloat scale = [UIScreen mainScreen].scale;
CGFloat scale = 2.0;
CGSize cellSize = ((UICollectionViewFlowLayout *)_collectionView.collectionViewLayout).itemSize;
AssetGridThumbnailSize = CGSizeMake(cellSize.width * scale, cellSize.height * scale);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment