[英]UIViewController - switch presented view controller without flash to presenting one?
I have a presenting view controller that presents a modal like VC, then when the user is done with that modal, I want to transition to another modal, but calling: 我有一个呈现视图控制器,呈现一个类似于VC的模式,然后当用户完成该模式后,我想过渡到另一个模式,但调用:
// we are done.
[self.presentingViewController dismissViewControllerAnimated:NO completion:nil];
if (self.showOtherContoller)
{
UIViewController* aVC = [[UIViewController alloc] initWithNibName:@"someNib" bundle:nil];
[self.presentingViewController aVC animated:NO completion:nil];
}
works, but the presenting base view controller shows for about a second, so it looks all flashy. 可以,但是当前的基本视图控制器显示了大约一秒钟,因此看起来很浮华。
Basically I want to replace one view controller with another, not temporarily drop to the presenting view controller. 基本上,我想用一个视图控制器替换另一个视图控制器,而不是暂时移到当前的视图控制器。
Thanks for any tips. 感谢您的提示。
Your modal transition style is CoverVertical. 您的模式过渡样式为CoverVertical。 The first modal slides back down when dismissed, exposing its presentingViewController, then the second modal slides up, hiding the presentingViewController.
当关闭时,第一个模式滑回向下,露出其presentingViewController,然后第二个模式滑向上方,隐藏presentingViewController。
You want to change the transition so it appears that the first modal is replaced by the second modal. 您想要更改过渡,以便第一个模态似乎被第二个模态代替。
Change both view controllers' modal transition styles to CrossDissolve before dismissing the first and presenting the second. 在关闭第一个并显示第二个之前,将两个视图控制器的模式转换样式都更改为CrossDissolve。 Before dismissing the second, change it to CoverVertical, so it slides down to match the first modal's slide up transition.
在关闭第二个模式之前,将其更改为CoverVertical,以便它向下滑动以匹配第一个模式的向上滑动过渡。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.