我想以编程方式将标题设置为标签项目,但它不起作用。我的代码如下:如何在目标c中以编程方式设置标签栏项目标题?
- (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;
}
你在哪里设置它? – Legolas
我编辑我的问题,请现在检查 –