不使用segue需要交叉溶解转换

RGr*_*ths 5 xcode ipad ios6

我想使用Cross Dissolve转换,但不使用segue.当按下按钮但转换为Cover Vertical时,我使用下面的代码显示新视图.有没有办法改变这个?

ObViewControllerMonitorMenu *monitorMenuViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"observationSummary"];
monitorMenuViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:monitorMenuViewController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

上面的代码现在使用附加行来设置转换类型.

Val*_*hie 7

请查看文档以查看过渡样式列表,同时以模态方式呈现视图控制器,尤其是在以下部分Presenting View Controllers:

https://developer.apple.com/reference/uikit/uiviewcontroller?language=objc

(快速答案)

然后,您可以将视图控制器的modalTransitionStyle属性设置为所需的值,您可以在其中获得所需的值UIModalTransitionStyleCrossDissolve.