Storyboard - 如何在基于导航的应用程序中从视图控制器连接到 SplitViewController

发布于 2025-01-08 10:52:23 字数 132 浏览 4 评论 0原文

我有一个基于 iPad 应用程序的导航控制器。我正在使用故事板进行应用程序设计。我需要从导航堆栈中的 ViewController 之一转到显示 splitviewcontroller 的屏幕。我该怎么办?

预先感谢您对此的任何帮助。

I have a navigation controller based iPad application. I am using storyboards for the app design. From one of the ViewControllers in the Navigation stack, I need to segue to a screen showing splitviewcontroller. how to I go about that ?

Thanks in advance for any help on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

素年丶 2025-01-15 10:52:23

UISplitViewController 必须始终是您使用的第一个/主视图控制器。您不能从 UINavigationControllerUITabBarController 或类似的地方使用它。

A UISplitViewController must always be the first/main view controller you use. You can't use it from a UINavigationController or a UITabBarController or similar.

等你爱我 2025-01-15 10:52:23

我遇到了完全相同的问题,我通过实现自定义转场解决了它。

@implementation LoginSegue
- (void) perform {
    NSLog(@"Do the segue you way");
    UIViewController *src = self.sourceViewController;
    UIWindow *window = src.view.window;
    [window addSubview:[self.destinationViewController view]];
    window.rootViewController = self.destinationViewController;
}
@end

这似乎对我有用。我希望当我向苹果提交代码时这是一个可以接受的解决方案。

I had the exact same problem and I solved it by implementing a custom segue.

@implementation LoginSegue
- (void) perform {
    NSLog(@"Do the segue you way");
    UIViewController *src = self.sourceViewController;
    UIWindow *window = src.view.window;
    [window addSubview:[self.destinationViewController view]];
    window.rootViewController = self.destinationViewController;
}
@end

This seems to have worked for me. I hope this is an acceptable solution when I submit the code to apple.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文