iphone - 如何在 iPhone 中设置 Tabbar 集成?

标签 iphone ios title tabbar

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

下面是供您引用的源代码。

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];

enter image description here

最佳答案

不要导航 View Controller ,否则包含 TabBar 的 Controller 将被弹出。

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

只需添加带有此类框架的新 Controller ,以便您的 TabBar 始终可见。

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

相关文章:

iphone - 无法下载应用程序,此时无法安装 <app-name>

iphone - 如何实现iPhone的文件浏览设计

android - 如何实现LinearLayout标题/标签

css - 隐藏标准的 AddThis 工具提示和图像

iphone - iphone/ipod 的序列号

ios - 自定义键盘高度大于默认键盘

iphone - 如何将空值分配给 NSData 而不是 NULL 值?

jquery 检查图像是否有标题属性

ios - 更改搜索栏的位置

ios - iPad 在 Landscape 中启动仅接收 768x768 内的触摸