我想在 UIImageView 上显示旋转的活动视图,并在图像完成加载并显示后停止并隐藏活动视图。该图像是从资产库拍摄的大照片。
- (void)viewDidLoad
{
//set photo
UIImageView *Photo = _photo;
NSURL *url = [[NSURL alloc] initWithString:project.photo];
ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];
[library assetForURL:url resultBlock:^(ALAsset *asset) {
ALAssetRepresentation *rep = [asset defaultRepresentation];
CGImageRef iref = [rep fullResolutionImage];
if (iref) {
self.photo.image = [UIImage imageWithCGImage:[rep fullScreenImage] scale:[rep scale] orientation:0];
}
} failureBlock:^(NSError *error) {
NSLog(@"Couldn't load asset %@ => %@", error, [error localizedDescription]);
}];
[_ImageLoader stopAnimating];
}
但是,这不起作用,因为活动视图不断旋转。