我瘋了解決這個問題。向UINavigationController添加標題+按鈕
我已經在我的AppDelegate.m
基本上是一個導航控制器+標籤欄下面的代碼鏈接到2 tableviewcontroller
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
ElencoSpese *elenco=[[ElencoSpese alloc] init];
[email protected]"Prova 123";
ElencoSpese *elenco2=[[ElencoSpese alloc] init];
[email protected]"Prova 222";
UITabBarController *tabMenu = [[UITabBarController alloc] init];
tabMenu.viewControllers=[NSArray arrayWithObjects:elenco, elenco2, nil];
UINavigationController *navig=[[UINavigationController alloc] initWithRootViewController:tabMenu];
self.window.rootViewController=navig;
[self.window makeKeyAndVisible];
return YES;
}
ElencoSpese
是TableViewController
,它工作正常。我想補充"title"
這個窗口和「+」和"Edit"
上的NavigationBar
....
我試過上面的按鈕來取消註釋在tableviewcontroller的方法的loadView如下:沒有結果
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
self.navigationItem.rightBarButtonItem = self.editButtonItem;
我alsto中的appdelegate試圖設置標題....沒什麼......
沒辦法....我添加(無結果...):自.window.rootViewController.tabBarController.navigationItem.title = @ 「僑」;自動窗口控制器。謝謝他幫助 – 2012-04-07 11:50:16
好的!現在,它的工作!謝謝! – 2012-04-07 11:58:39