我正在使用UITabBar开发iPhone应用程序。标签栏中只有第二个标签标题可见,而标签中第一个标签标题没有显示,如何解决?请帮我,
提前致谢。

以下是供您参考的源代码。

NSMutableArray *items = [[NSMutableArray alloc]init];
tab =[[UITabBar alloc]initWithFrame:CGRectMake(0, 300, 320, 44)];

[self.tabBarItem initWithTitle:@"sample1" image:nil tag:111];
[items addObject:self.tabBarItem];

[self.tabBarItem initWithTitle:@"sample2" image:nil tag:101];
[items addObject:self.tabBarItem];

[tab setItems:items animated:YES];
[self.view addSubview:tab];

最佳答案

不要浏览视图控制器,因为包含TabBar的控制器会弹出。

当我们使用UITabBar时,我们不会以这种方式使用导航。

只需使用这样的框架添加新的控制器,就可以使您的TabBar可见。

关于iphone - 如何在iPhone中设置Tabbar集成?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12401993/

10-14 22:37
查看更多