开发者

Iphone flip views using block animation methods

Hi I have looked without success for the answer to this. Am trying to flip views o开发者_如何学JAVAn iphone app. Rather than using the usual iOS3 methods I want to use block methods to animate the transition. Can anyone suggest a snippet of code to help please?


I tried the animateWithDuration method suggested above, and it didn't work. I couldn't get it working until I used the following:

[UIView transitionFromView:viewOld 
                    toView:viewNew
                  duration:.75 
                   options:UIViewAnimationOptionTransitionFlipFromLeft | UIViewAnimationCurveEaseIn 
                completion:^(BOOL finished)
                {
                    // cleanup viewOld
                }
 ];


[UIView animateWithDuration:0.5
                      delay:0.0 
                    options:UIViewAnimationOptionTransitionFlipFromLeft 
                 animations:^{
                                 // Exchange the views here
                                 [view1 removeFromSuperview];
                                 [mySuperview addSubview:view2]; 
                             }
                 completion:NULL];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜