Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide an iPhone Tab Bar?

I have a small multiview app. It consists of a UITabBarController with a nav controller in each tab. What I want is to show a UIImageView when a user shakes the device. After I've implemented the loading of the UIImageView, I faced a problem-the image was only 2/3 of the screen because of the tab and nav bars. I managed to hide the nav bar but I'm still stuck with the tab bar. I tried many solutions such as [tabBar setHidden: YES]; but I get errors "tabBar undeclared", although I've imported the AppDelegate, where the tabBar was defined.

Thanks in advance!

like image 444
Knodel Avatar asked Nov 22 '25 05:11

Knodel


1 Answers

Try setting

myViewController.hidesBottomBarWhenPushed = YES;

when you create your UIImageView. When you push it on to the view stack the UITabBar will hide automatically, and it will be restored automatically when you pop or dismiss the controller. No need for the application delegate.

like image 120
Eric Schweichler Avatar answered Nov 23 '25 23:11

Eric Schweichler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!