简体   繁体   English

如何在情节提要中将选项卡栏与其视图控制器链接起来?

[英]How to link a tab bar with its view controllers in a storyboard?

If you've only ever used a tab bar controller and not a tab bar on its own, then don't close this or mark it as a duplicate based upon your presumptions and assumptions. 如果您只使用了标签栏控制器,而没有单独使用标签栏,则不要根据您的假设和假设将其关闭或将其标记为重复项。

I've added a tab bar to a view controller and now want to connect the tab bar with the view controllers that will be selected via it. 我已经将标签栏添加到视图控制器,现在想将标签栏与将通过它选择的视图控制器连接。

I've done this sort of thing many, many times before using a tab bar controller and assumed it would be just as straightforward as but when a using just a tab bar but no - I just can't find or see any way of doing it. 在使用标签栏控制器之前,我已经做过很多次这样的事情,并认为它就像直接使用标签栏但不使用时一样简单-我只是找不到或看到任何方法它。 Tried adding tab bar items to the view controller and tried dragging between these and the tab bar, and between the tab bar and the tab bar items and to the view controllers. 尝试将选项卡栏项目添加到视图控制器,并尝试在它们和选项卡栏之间,选项卡栏和选项卡栏项目之间以及视图控制器之间拖动。 Millions of combinations and can't get it to work. 数以百万计的组合无法正常工作。

Googling or searching for past questions on this isn't as straightforward as you'd think - because the search results all come back involving the use of a tab bar controller, I can't see anything for just a tab bar which is part of a regular view controller. 谷歌搜索或搜索过去的问题并不像您想的那么简单-因为搜索结果全部返回,涉及到使用选项卡栏控制器,所以对于仅属于其中一部分的选项卡栏我什么也看不到常规视图控制器。

I think, this is not possible using a storyboard. 我认为,使用分镜脚本是不可能的。 You should do this in code. 您应该在代码中执行此操作。

Or maybe hideBottomBarWhenPushed is what you are searching for. 也许hideBottomBarWhenPushed是您要搜索的内容。

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

相关问题 如何在故事板的标签栏上启动导航控制器的第三个视图控制器 - how to start third view controller of navigation controllers on tab bar in storyboard 使用故事板视图控制器创建程序化选项卡栏? - Creating a programmatic tab bar with storyboard view controllers? 如何将标签栏控制器放在视图控制器而不是委托中? - How to put tab bar controllers inside of view controllers and not the delegate? iOS-如何将选项卡与情节提要中的特定视图控制器链接? - iOS - How to link tabs with specific view controllers in storyboard? 在标签栏中重新加载视图控制器 - Reload view controllers in tab bar 如何在Tab Bar Controller Storyboard中添加视图 - How to add view inside Tab Bar Controller Storyboard 如何在不同故事板的标签栏上显示拆分视图控制器? - How to show split view controller on tab bar from different storyboard? 如何将两个视图控制器添加到一个选项卡栏项 - How to add two view controllers to one tab bar item 如何在带有Tab Bar Controller的View Controller之间传输浮点值? - How to transfer a float value between View Controllers with Tab Bar Controller? 如何使用标签栏在Container View中管理控制器 - how can I manage controllers in Container View with using tab bar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM