简体   繁体   English

UIViewController-将没有Flash的呈现视图控制器切换为呈现一个?

[英]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.

相关问题 调用viewWillAppear时显示视图控制器的问题被解除 - Issue with calling viewWillAppear of presenting view controller when presented one is dismissed 如何在没有用户能够看到呈现视图的情况下使用模态视图控制器启动iOS应用程序? - How to start an iOS app with a modal view controller already presented without the user being able to see the presenting view? 如何在呈现的View Controller和呈现的View Controller之间建立关系? - How to setup a relationship between the presenting View Controller and the presented View Controller? 呈现视图 controller 位于呈现视图 controller 下方 - Presented view controller place under presenting view controller 使用CAShapeLayer遮罩呈现的视图控制器,也遮罩呈现的视图控制器 - masking presented view controller with CAShapeLayer also mask the presenting view controller 如何暂时隐藏同时呈现视图控制器的呈现视图控制器 - How to temporarily hide a presented View controller that is also presenting a view controller 呈现视图 controller 也可以是呈现视图 controller 吗? - Can a presented view controller also be a presenting view controller? 旋转呈现的视图并锁定呈现视图控制器的方向 - Rotate presented view and lock the orientation of presenting view controller 消除演示的VC时,Presenting View Controller失去子视图 - Presenting View Controller loses subviews when dismissing presented VC iOS /自动版式:取消已演示的控制器后,更改为演示视图 - IOS/Autolayout: Change to Presenting View After Presented Controller Dismissed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM