我创建了一个导航控制器,但我不能设置标题或添加按钮,导航bar.How这样做呢? 这是应用DidFinishLauchingOption的文件AppDelegate.m代码:设置标题,并添加按钮,导航控制器
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:view];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
self.view = [[ViewController alloc] init];
self.window.rootViewController = self.view;
[self.window addSubview:navController.view];
[self.window makeKeyAndVisible];
return YES;
}
在此先感谢。
它不工作。我放入我的视图控制器的所有东西都没有出现。 :( – lncnb91 2013-04-09 16:13:35
哦,我只试了一次有更多的时间和它的作品。谢谢! – lncnb91 2013-04-09 16:21:27