简体   繁体   中英

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.

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.view addSubview:theViewYouWantToShow];

If you'll call a viewController using presentModelViewController , it'll hide the tabbar of the application. 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)
  2. Or as Sumit suggested add anotherViewController.view as subView on firstViewController

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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