【问题标题】:Custom UIStoryboardSegue Push and Pop matching animations自定义 UIStoryboardSegue 推送和弹出匹配动画
【发布时间】:2012-07-02 06:48:16
【问题描述】:

我在 UIStoryBoardSegue 中有以下代码来执行 curl-up push segue。

 (void) perform {

    UIViewController *src = (UIViewController *) self.sourceViewController;
    UIViewController *dst = (UIViewController *) self.destinationViewController;

    [UIView transitionWithView:src.navigationController.view duration:1
                       options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionTransitionCurlUp
                    animations:^{
                        [src.navigationController pushViewController:dst animated:NO];
                    }
                    completion:NULL];

}

它工作正常,但是当我点击应用程序上的“返回”按钮时,它会向后滑动而不是向下卷曲。因为这是一个推送,所以我需要弹出当前视图控制器而不是添加另一个 segue。

我如何做一个“卷曲流行segue”?

【问题讨论】:

    标签: ios uistoryboardsegue


    【解决方案1】:

    对于现在关注这一点的任何人,iOS 7 都可以让您以两种方式制作动画:

    将 segue 设置为 Push,然后查看下面的代码以了解推送实现。

    https://github.com/Dzamir/OldStyleNavigationControllerAnimatedTransition

    【讨论】:

      【解决方案2】:

      我在 SO 上发现了这个问题,可能对您有所帮助:Reversal of Custom Segue with Storyboarding

      但这可能不是一个完美的解决方案。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-02-19
        • 2010-11-27
        • 2019-12-09
        相关资源
        最近更新 更多