我想设置标题选项卡项编程,但它不起作用。我的代码如下:
- (IBAction)tab1Click:(id)sender {
myTabBarController = [[UITabBarController alloc] init];
view2Controller = [[View2Controller alloc] init];
[view2Controller setTitle:@"title"];
view3Controller = [[View3Controller alloc] init];
deneme = [[ViewController alloc] init];
myTabBarController.viewControllers = [NSArray arrayWithObjects:deneme, view2Controller,view3Controller, nil];
[self.view addSubview:myTabBarController.view];
myTabBarController.selectedIndex=1;
}发布于 2012-09-26 23:16:28
如何在实际的View Controller (而不是App Delegate)中执行此操作:
// set tab title
self.title = @"Tab Title";
// optionally, set different title for navigation controller
self.navigationItem.title = @"Nav Title";
// Note: self.title will reset Nav Title. Use it first if you want different titleshttps://stackoverflow.com/questions/8925950
复制相似问题