开发者

How to hide view when animation ends?

开发者 https://www.devze.com 2023-04-03 08:56 出处:网络
I\'m using the curlup and curldown animation开发者_运维百科 that works great. My problem is my view is still present for a second before it pushes the viewcontroller. How do I hide current view when a

I'm using the curlup and curldown animation开发者_运维百科 that works great. My problem is my view is still present for a second before it pushes the viewcontroller. How do I hide current view when animation ends?


Hope this code will help to u....

once check it..... .

when your animation completed at that time "customView" frame sizes are set (x,y,0,0).... like below

-(void)close_but{   
CGRect viewTopFrame = CGRectMake(150,240,0,0);
[UIView animateWithDuration:0.5
            delay:0
            options: UIViewAnimationCurveEaseOut
             animations:^{
                 "customView".frame = viewTopFrame;

                     } 
                     completion:^(BOOL finished){
                         NSLog(@"Done!");
                     }];
customView.frame=viewTopFrame;


you can set the view's alpha to to 0 once animation is complete like:

[customView setAlpha:0];
0

精彩评论

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