【问题标题】:Unwind segues---AnimationUnwind segues---动画
【发布时间】:2014-01-18 16:21:32
【问题描述】:

我从这里读到了关于 unwind segues 的精彩解释: What are Unwind segues for and how do you use them? 然后在我自己的项目中尝试,一切正常,只有一个问题,正如“push segue”Xcode提供的那样,展开segues默认执行动画,我必须使用自定义push segue来摆脱动画,然后是这个:Push segue in xcode with no animation

#import <UIKit/UIKit.h>

@interface PushNoAnimationSegue : UIStoryboardSegue

@end

#import "PushNoAnimationSegue.h"

@implementation PushNoAnimationSegue
-(void) perform{
    [[[self sourceViewController] navigationController] pushViewController:[self destinationViewController] animated:NO];
}
@end

我还能做些什么来关闭展开转场的动画。有人可以帮忙吗?

【问题讨论】:

标签: ios uistoryboardsegue


【解决方案1】:

对于 iOS9:

Interface Builder(在 Xcode 7 中)列出了展开 segue。从那里,您可以选择它并简单地取消选中 animated 属性以关闭展开动画。

对于 iOS 7 和 8:

在目标控制器的unwind 方法中,您必须使用animated: NO 弹出。

【讨论】:

    猜你喜欢
    • 2014-11-12
    • 2017-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多