gpt4 book ai didi

iphone - 将 UINavigationController 添加到 iPhone 上的 subview

转载 作者:搜寻专家 更新时间:2023-10-30 20:27:28 24 4
gpt4 key购买 nike

我一直在尝试将此 UINavigationController 添加到我的表单的 subview 中......我得到的只是一个大的灰色屏幕。

LiteViewController *lite = [[LiteViewController alloc] initWithNibName:@"LiteViewController" bundle:nil];
[self.view addSubview:lite.navigationController.view];

它应该向当前 View 添加一个全屏导航 Controller 。

最佳答案

我找到了一个帖子, UINavigationController not showing the Root View controller ,这对我有用。

基本上你还需要设置navigationController的view...

[self.view addSubview:navigationController.view];
[navigationController setView:[[navigationController.viewControllers objectAtIndex:0] view]];

关于iphone - 将 UINavigationController 添加到 iPhone 上的 subview ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3113985/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com