我疯了解决这个问题。向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