【问题标题】:Animation properties of presentViewControllerpresentViewController 的动画属性
【发布时间】:2015-12-06 17:37:01
【问题描述】:

我正在实现 UIViewControllerAnimatedTransitioningUINavigationControllerDelegate 来创建自定义推送动画。我希望推送看起来与presentViewController 使用的上滑动画完全一样。

我目前正在使用 0.4 秒的持续时间和 UIViewAnimationOptionCurveEaseOut,它看起来非常接近标准的 presentViewController 动画,但我不想只相信我的眼睛。

有谁知道presentViewController 的动画属性是什么,以便我可以确保我完全模仿它们?

我使用自定义推送动画而不是仅使用模态视图控制器是有原因的。不希望这分散我提出的问题的注意力。 提前致谢!

【问题讨论】:

    标签: ios objective-c uiviewanimation


    【解决方案1】:

    使用这行代码

    UIViewController *yourViewController = [[UIViewController alloc]init];
    
    [UIView  beginAnimations: @"Showinfo" context: nil];
    [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:0.75];
    [self.navigationController pushViewController: yourViewController animated:NO];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
    [UIView commitAnimations];
    

    我使用动画持续时间 0.75 看起来像模态视图演示。 检查这个original thread

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多