我創建了一個導航控制器,但我不能設置標題或添加按鈕,導航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