2011-10-23 36 views
1

動畫圖像陣列我有,我想一個UIImageView動畫如何在iOS的

我知道如何用這種方法做這個圖像陣列:

[myImageView setAnimationImages:myImageArray]; 
[myImageView setAnimationDuration:.7]; 
[myImageView setAnimationRepeatCount:1]; 
[myImageView startAnimating]; 

不過,我想使用不同的方法。我想這樣做

[UIView animateWithDuration:.7 delay:0 options:(UIViewAnimationOptionAllowUserInteraction) 
       animations:^{ 
        // animate image array 
       } 
       completion:^(BOOL finished){ 
        // [self animationEnded]; 
       } 
]; 

,但我不知道要放什麼東西在那裏我有//動畫圖像陣列

回答

-2

也許[UIView的setAnimationDelegate:個體經營]會幫你嗎? [UIView] setAnimationDidStopSelector:@selector(animationDidStop:finished:context :)];將執行你的animationDidStop :: then。

或者,如果你想堅持使用塊,我認爲這將是一系列嵌套的動畫完成的部分像

[UIView animateWithDuration:.7 delay:0 options:(UIViewAnimationOptionAllowUserInteraction) 
       animations:^{ 
        // Show first image 
       } 
       completion:^(BOOL finished){ 
        // Hide first image 
        [UIView animateWithDuration:.7 delay:0 options:(UIViewAnimationOptionAllowUserInteraction) animations:^{ 
        // Show second image 
        } 
        completion:^{ 
         // Hide second image 
        } 
       } 
+0

讓我怎麼用[UIView的setAnimationDidStopSelector:@selector(animationDiddStop:成品:上下文:)];因爲我真正想要的是在特定動畫結束時能夠調用方法。是否像[UIView setAnimationDidStopSelector:@selector(animationDiddStop:finished:context:myImageView)]; ??? – user975134