Objective C Segues, dissolve programmatically(目标C序列,以编程方式分解)
问题描述
我有两个类,machineClass和ButtonsClass...在Button类中,我想要一个以编程方式推入machineClass的按钮。我已经处理好了:
machineClass *mc = [self.storyboard instantiateViewControllerWithIdentifier:@"machineClass"];
mc.passedString = purchase;
[self presentViewController:mc animated:YES completion:nil];
但是,这使用默认的分段动画(其中视图是垂直向上的),我认为如果我使用交叉融合过渡,我的应用程序看起来会好得多。
有人能帮忙吗?我想出的最佳解决方案是将其更改为:
[self presentViewController:mc animated:NO completion:nil];
但我不太喜欢这个……
谢谢!
推荐答案
您可以在情节提要中设置目标视图控制器的模式转换样式。或代码:
machineClass *mc = [self.storyboard instantiateViewControllerWithIdentifier:@"machineClass"];
mc.passedString = purchase;
mc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:mc animated:YES completion:nil];
这篇关于目标C序列,以编程方式分解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!