简体   繁体   中英

How to hide a tab bar view controller with another view controller over it?

In Periscope Live Broadcast app, when you click on WORLD tab bar and then tap on "List" and you tap to watch a live stream, the Live stream view controller will pop up from the bottom covering the entire tab bar view controller with the tab bar completely hidden.

(I'm currently using Tab Bar Controller and Navigation Controller and I can't get it done)

How is this done?

You can call your "modal" view controller programmatically:

NSString * storyboardName = @"MainStoryboard"; 
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil];
UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"IDENTIFIER_OF_YOUR_VIEWCONTROLLER"];
[self presentViewController:vc animated:YES completion:nil];

IDENTIFIER_OF_YOUR_VIEWCONTROLLER is the name you set in your storyboard. You can assign in the identity inspector of your storyboard.

This view will cover your screen as a modal

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