8

次のアニメーション ブロックがあります。

[UIView animateWithDuration:2 
                 animations:^{ 
                     [childViewController_.view setAlpha:0];  
                 } 
                 completion:^(BOOL finished) {
                     [childViewController_.view removeFromSuperview];
                 }];

上記のように実行すると、完了ブロックがすぐに呼び出されます。ただし、完了ブロックがない場合、アニメーションは期待どおりに実行されます。

ここで何が間違っていますか?

更新
完了ブロック のfinishedフラグは ですNO

4

1 に答える 1

1

1つの条件をチェックするのを忘れただけです

[UIView animateWithDuration:2 
                 animations:^{ 
                     [childViewController_.view setAlpha:0];  
                 } 
                 completion:^(BOOL finished) {
                     if (finished)
                     {
                          [childViewController_.view removeFromSuperview];
                     }
                 }];
于 2013-03-14T08:09:12.020 に答える