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

ヘリウムは正しいです。cal を結果ブロック内の [_ImageLoader stopAnimating] に移動するか、アニメーションが開始される前に停止してしまいます。

于 2012-04-04T14:11:51.690 に答える
1

スピナーは常にアニメーション化されます。

- (void)viewWillAppear:(BOOL)animated;

後に呼び出されます

- (void)viewDidLoad

つまり、基本的には、スピナーに停止するように指示した後にアニメーション化するように指示します。

幸運を!

于 2012-04-04T12:29:25.243 に答える