如何在没有动画的情况下以编程方式进行 "show (e.g Push)" 转场?
How to do a "show (e.g Push)" segue programatically without animation?
如何在没有动画的情况下以编程方式进行 "show (e.g Push)" 转场?
None 我发现的解决方案与情节提要中的解决方案的工作方式相同。
show (e.g. Push)
segue 在内部做的是调用
-[UIViewController showViewController:sender:]
在您的视图控制器本身上调用此方法,将触发呈现您正在传递的视图控制器的适当方式。
// Swift
self.showViewController(viewControllerToShow, sender: self)
// Objective-C
[self showViewController: viewControllerToShow sender: self];
可以删除动画,方法是将调用包装在 +[UIView performWithoutAnimation:] 块中。
// Swift
UIView.performWithoutAnimation {
self.showViewController(viewControllerToShow, sender: self)
}
// Objective-C
[UIView performWithoutAnimation:^void () {
[self showViewController: viewControllerToShow sender: self];
}]
如何在没有动画的情况下以编程方式进行 "show (e.g Push)" 转场? None 我发现的解决方案与情节提要中的解决方案的工作方式相同。
show (e.g. Push)
segue 在内部做的是调用
-[UIViewController showViewController:sender:]
在您的视图控制器本身上调用此方法,将触发呈现您正在传递的视图控制器的适当方式。
// Swift
self.showViewController(viewControllerToShow, sender: self)
// Objective-C
[self showViewController: viewControllerToShow sender: self];
可以删除动画,方法是将调用包装在 +[UIView performWithoutAnimation:] 块中。
// Swift
UIView.performWithoutAnimation {
self.showViewController(viewControllerToShow, sender: self)
}
// Objective-C
[UIView performWithoutAnimation:^void () {
[self showViewController: viewControllerToShow sender: self];
}]