How to fetch squared thumbnails from PHImageManager?

后端 未结 5 845
日久生厌
日久生厌 2021-01-31 04:51

Has anybody idea how to fetch squared thumbs from PHImageManager? PHImageContentModeAspectFill option has no effect.

[[PHImageManager defaultManager]
  requestIm         


        
5条回答
  •  庸人自扰
    2021-01-31 05:38

    This is working fine for me :

     __block UIImage* imgThumb;
    
    CGSize size=CGSizeMake(45, 45);// Size for Square image
    
    [self.imageManager requestImageForAsset:
                                 targetSize:size
                                contentMode:PHImageContentModeAspectFill
                                    options:nil
                              resultHandler:^(UIImage *result, NSDictionary *info) {
    
                                  imgThumb = result;
    
      }];
    

提交回复
热议问题