Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to Hide iPhone Status Bar White Space

Tags:

iphone

I have a scroll-view with a UIImage on top the UIImage has its own view controller class and the scroll view is on the main root-controller. I added the hide status bar method to the root-controller but when I run the program the status bar disappears but leaves a white space and the view does not grow over the status bar white space. I tired other methods but I still get the same white space I also tried to enable scroll vertical and it looks like the status bar is on top of all my views, when I scroll up it keeps going up under the status bar.

What could be causing this?

like image 862
Silent Avatar asked Jan 22 '23 21:01

Silent


1 Answers

You just hid the status bar, seems like other components did not automatically expand to take over that space. Make sure you have "auto-resize subviews" enabled in all components under main root-controller.

If that doesn't help, you could try relocating and resizing your view in code. Something like:

CGRect frame = self.view.frame;
frame.origin.y -= statusBar.height;
frame.size.height += statusBar.height;
self.view.frame = frame;
like image 136
JOM Avatar answered Jan 31 '23 11:01

JOM