简体   繁体   English

iOS如何选择没有标签栏项目的标签栏视图控制器?

[英]iOS How to implement Tab Bar View Controller with no tab bar item selected?

I have gone through almost all question related to this on Stack Overflow 我在Stack Overflow上经历了与此相关的几乎所有问题

What I what to do is to show TabBarViewController as in the image. 我要做的是在图像中显示TabBarViewController。

在此输入图像描述

Is there any way to achieve this in my tab bar view controller app? 有没有办法在我的标签栏视图控制器应用程序中实现这一点?

NO, there needs to be at least one Tab selected. 不,需要选择至少一个选项卡。 By default the Tab bar will select the first view controller object. 默认情况下,Tab栏将选择第一个视图控制器对象。

if you want to use Tabbar more flexible, you can use a customView instead of TabBarViewController's tabor, just like: 如果你想更灵活地使用Tabbar,你可以使用customView而不是TabBarViewController的tabor,就像:

UIView *customTabBar = [[UIView alloc] init];    
customTabBar.frame = self.tabBar.bounds;      
[self.tabBar addSubview:customTabBar];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS标签栏控制器:未选择标签项的首页消息 - iOS Tab Bar Controller : home message without tab item selected 显示具有选定TableView项和选项卡栏控制器的View Controller - Show View Controller with Selected TableView Item and Tab Bar Controller 当选择选项卡栏项目视图控制器时调用viewWillDisappear - viewWillDisappear called when tab bar item selected view controller set 如何使用标签栏项添加导航栏以查看控制器 - How to add Navigation bar to view controller with tab bar item 标签栏控制器 - 如何重新选择选定的标签 - Tab Bar Controller - how to reselect a selected tab 如何在标签栏控制器中更新标签上的视图 - How to renew view on tab in tab bar controller 如何在1项标签栏控制器中制作顶部标签栏以在swift中显示多个视图控制器? - How to make top tab bar inside 1 item tab bar controller to show multiple view controller in swift? Swift 2从视图控制器返回到选项卡栏控制器中的选定选项卡 - Swift 2 Return to a selected tab in tab bar controller from view controller 没有选项卡的iOS选项卡栏项目 - iOS tab bar item with no controller associated 如何将视图控制器推送到iOS中标签栏中的导航控制器 - how to push a view controller to a navigation controller in a tab bar in iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM