gpt4 book ai didi

ios - 如何以编程方式添加导航 Controller ?

转载 作者:可可西里 更新时间:2023-11-01 05:04:29 24 4
gpt4 key购买 nike

我使用下面的代码,但没有加载:

UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
self.mapViewController = [storyboard instantiateViewControllerWithIdentifier:@"MapViewController"];
self.navigationController = [[UINavigationController alloc]initWithRootViewController:self];

self.navigationBar = [[UINavigationBar alloc]init];
[self.view addSubview:self.navigationBar];

[self.navigationController.navigationController pushViewController:self.mapViewController animated:YES];

最佳答案

尝试如下

UIViewController *bbp=[[UIViewController alloc]initWithNibName:@"UIViewController" bundle:nil];
UINavigationController *passcodeNavigationController = [[UINavigationController alloc] initWithRootViewController:bbp];
// [self.navigationController presentModalViewController:passcodeNavigationController animated:YES];
[self.navigationController pushViewController:passcodeNavigationController animated:YES];
[passcodeNavigationController release];

关于ios - 如何以编程方式添加导航 Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21609921/

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