2 daffodilgirl DaffodilGirl 于 2013.03.20 13:40 提问

iphone中使用弹出动画

使用了下面的代码:

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

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

1个回答

vikeyToy
vikeyToy   2013.03.20 15:51
已采纳
-(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]; 
    }
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!