简体   繁体   中英

Show and Hide Navigation and Tab Bar in Swift 2.3

I am developing a iOS application having tabBar navigation. My requirement is that first time the app starts I need to play a video which should show on top of the tabbar and the navigation bar. To do this I did -

self.tabBarController!.tabBar.hidden = true
self.navigationController!.navigationBar.hidden = true

But if I hide the tabBar and navigation Bar, the elements in my View which shows after the video is played get stretched. Can some one give me a better solution to this. XCode 8.0, Swift 2.3

Thanks.

Try to set,

 self.extendedLayoutIncludesOpaqueBars=true;

You can set it from interface builder also - select your view controller - attribute inspector - under view controller - Check Under opaque bars(under extend edges)

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