0

我想在 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];
}

但是,这不起作用,因为活动视图不断旋转。

4

2 回答 2

1

微调器始终是动画的,因为

- (void)viewWillAppear:(BOOL)animated;

被调用后

- (void)viewDidLoad

所以基本上你在告诉微调器停止后告诉它动画。

祝你好运!

于 2012-04-04T12:29:25.243 回答
1

氦气是对的。您想将 cal 移动到结果块内的 [_ImageLoader stopAnimating],或者最终在动画开始之前停止动画。

于 2012-04-04T14:11:51.690 回答