我想在 UIImageView 上显示旋转的事件 View ,并在图像加载完成并显示后停止并隐藏事件 View 。该图像是从 Assets 库中拍摄的大照片。
- (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];
}
然而,这不起作用,因为事件 View 一直在旋转。
最佳答案
微调器始终是动画的,因为
- (void)viewWillAppear:(BOOL)animated;
在
之后调用- (void)viewDidLoad
所以基本上你告诉微调器在告诉它停止后动画。
祝你好运!
关于objective-c - 当 UIImageView 图像完成加载时停止动画 UIActivityIndicatorView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10010629/