当前位置: 代码迷 >> Iphone >> iphone饮弹出动画的实现
  详细解决方案

iphone饮弹出动画的实现

热度:82   发布时间:2016-04-25 06:02:53.0
iphone中弹出动画的实现

原问题来自于CSDN问答频道,更多解决方案见:http://ask.csdn.net/questions/1785

问题描述:

使用了下面的代码:

FirstView * fir=[[FirstView alloc]init];[self.navigationController pushViewController:fir animated:NO];


能否实现一个弹出动画?
谢谢

解决方案:

-(void)ButtonAction:(id)sender{  [self SwipeRight:self.navigationController.view];  // <--calling method  //[self.navigationController pushViewController:viewcontrollerobject animated:NO];  // or pop // }    -(void)SwipeRight:(UIView *)view{        CATransition* transition = [CATransition animation];        [transition setDuration:0.3];        transition.type = kCATransitionPush;        transition.subtype = kCATransitionFromRight;        [transition setFillMode:kCAFillModeBoth];        [transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];        [view.layer addAnimation:transition forKey:kCATransition];     }    -(void)SwipeLeft:(UIView *)view{        CATransition* transition = [CATransition animation];        [transition setDuration:0.3];        transition.type = kCATransitionPush;        transition.subtype = kCATransitionFromLeft;        [transition setFillMode:kCAFillModeBoth];        [transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];        [view.layer addAnimation:transition forKey:kCATransition];     }


 

  相关解决方案