目标C序列,以编程方式分解 [英] Objective C Segues, dissolve programmatically

查看:23
本文介绍了目标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序列,以编程方式分解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆