我并不完全了解上下文,但您应该使用导航控制器。
在你的代码可以东西以下影响:
MyViewController *myView = [[MyViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myView];
// Do customisation here
[self.view addSubView:navController]
我不太清楚,如果这是你想要的,但你也可以考虑在应用程序委托中使用一个UINavigationController:
MyViewController *myView = [[MyViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myView];
// Do customisation here
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[window addSubview:nav.view];
[window makeKeyAndVisible];
我希望这有助于
嗨弗雷德,它是正确的,只有一件事[self.view addSubView:navController]为[self.view addSubView:navController.view] – Sanniv 2010-11-22 08:10:33
'@s anniv'谢谢! – Fred 2010-11-23 01:27:28