iOS:通过splitViewController以模态方式呈现UIViewController(表单页表)

iOS:通过splitViewController以模态方式呈现UIViewController(表单页表),第1张

概述我有一个UISplitViewController(是rootViewController) 和一个UIViewController,vc1. 我试图从MasterViewController部分向我的分割视图控制器上呈现vc1: vc1.modalPresentationStyle = UIModalPresentationPageSheet;[self presentViewControll 我有一个UISplitVIEwController(是rootVIEwController)
和一个UIVIEwController,vc1.

我试图从MasterVIEwController部分向我的分割视图控制器上呈现vc1:

vc1.modalPresentationStyle = UIModalPresentationPageSheet;[self presentVIEwController:vc1 animated:YES completion:nil];

这引发了一个例外:

Terminating app due to uncaught exception 'NSinvalidargumentexception',reason: 'Application trIEd to present modally an active controller <MasterVIEwController: 0x8c5dd30>.'

……而且崩溃了.

试过这个:

[self.splitVIEwController presentVIEwController:vc1 animated:YES completion:nil];

这引发了一个例外:

Terminating app due to uncaught exception 'NSinvalidargumentexception',reason:'Application trIEd to present modally an active controller <UISplitVIEwController:0x8c7e3a0>.'

但是,如果我尝试使用界面构建器(segues),它可以工作.

如何以编程方式在分割视图控制器上以模态方式(作为页面表或表单)呈现视图控制器?

解决方法 您可以告诉DetailVIEw控制器显示它.我想这样的事情.

DetailVC *detailVC = [self.splitVIEwController.vIEwControllers objectAtIndex:1];[detailVC presentVIEwController:vc1 animated:YES completion:nil];

我想问题是你的主人提出了一个详细视图,这就是为什么它不能提供任何其他东西,所以你要求详细视图为你做.

总结

以上是内存溢出为你收集整理的iOS:通过splitViewController以模态方式呈现UIViewController(表单/页表)全部内容,希望文章能够帮你解决iOS:通过splitViewController以模态方式呈现UIViewController(表单/页表)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1081751.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存