iOS推送到TabBarController [英] iOS Push to TabBarController
问题描述
例如,我有这样的东西:
如何从第一个视图转到标签栏控制器?
我试图仅设置按钮到选项卡栏控制器的按动,但是它运行不正确.
您必须将按钮的视图控制器嵌入到UINavigationController
中,否则会出现如下错误:
由于未捕获的异常"NSGenericException"而终止应用程序,原因:仅在由UINavigationController的实例管理源控制器时才能使用推送选择."
一旦将其放在UINavigationController
中,它在测试中的过渡就很好.
如果您不希望使用UINavigationController
,则可以将segue设置为Modal,它也应该过渡到Tab栏,但以模态进行.
i have several viewcontrollers, and at the last viewcontroller, i want when the users click on a button present in this view, he goes on a other view controller which contains tabbarcontroller.
For example, i've something like this :
How can i go from the first view, to the tab bar controller ?
EDIT : i tried to just set a push from the button to the tab bar controller, but it's not runnin g correctly.
You have to embed the button's view controller in a UINavigationController
, otherwise you will get an error like this:
Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
Once I put it in a UINavigationController
, it transitioned just fine in my tests.
If you do not want a UINavigationController
, you can set the segue to Modal, and it should also transition to the Tab Bar, but modally.
这篇关于iOS推送到TabBarController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!