简体   繁体   English

我想从1选项卡的模式视图中显示TABBAR控制器

[英]I wanna show TABBAR controller in modal view from 1 tab

I made a tabbar-based controllers with 5 tabs and at 1st tab, there's a button to call a modal view. 我制作了一个基于标签栏的控制器,其中包含5个选项卡,在第一个选项卡上,有一个按钮可以调用模式视图。

but when a modal view showed up, there's no tabbar on it. 但是当出现模式视图时,它上面没有标签栏。

How do I show a tabbar at that presented modal view ? 如何在显示的模式视图中显示标签栏?

For example if FirstViewController is the first viewController for your first tabbar, you should do like this: 例如,如果FirstViewController是第一个选项卡栏的第一个viewController,则应这样做:

[FirstViewController.view addSubview:theViewYouWantToShow]; [FirstViewController.view addSubview:theViewYouWantToShow];

If you'll call a viewController using presentModelViewController , it'll hide the tabbar of the application. 如果使用presentModelViewController调用viewController ,它将隐藏应用程序的viewController You can use either of 2 way: 您可以使用以下两种方式之一:

  1. Set navigationController in first tab and push anotherViewController (without animation if you don't wanna show push effect) 在第一个tab设置navigationControllerpush anotherViewController (如果您不想显示推送效果,则无需动画)
  2. Or as Sumit suggested add anotherViewController.view as subView on firstViewController 或者,正如萨米特建议添加anotherViewController.view作为子视图firstViewController

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM