Pregunta

I have a ViewController which need to hide the status bar sometimes. The problem is the view of the UIViewController is not autoresized after the status bar is hidden. (Actually I have another application use the exactly the same View Controller. Which has no problem at all). Can anybody advise which could be the cause of the problem? Thanks

Please refer to my screen shots. The first one is the view before I hide the status bar and the navigation bar. The second one is after I hide the status bar and navigation bar. You can see that the there is obvious black area which previously occupied by status bar.

enter image description here

enter image description here

¿Fue útil?

Solución

Seems wantsFullScreenLayout of your view controller isn't set to YES.

Otros consejos

[self.navigationController.navigationBar setBarStyle:UIBarStyleBlackTranslucent]; 
[self setWantsFullScreenLayout:YES]; 

Try this in your viewDidLoad. Additionally to full screen layout I think the bar style must be traslucent.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top