Question

I've got this simple problem that is really making me crazy.
I've got a navigation controller, the root view controller is a VC that has a view that should be presented without displaying the navigation bar. To achieve that I've set the navigationBarHidden property of the navigationController bar to YES in the -viewWillAppear: method, inside the rootVC.

To display it again I've set in the -viewWillDisappear: method of the rootVC the same property to NO.

If I ask the view its frame.size it will answer correctly 320 width and 460 height. When I push another view (I can see navbar appear) if I ask the view for its size it says me that is 320x460 and this wrong it should tell me something like 320x416.
If I push another view and ask for its size now I get the correct size 320x416. If now I pop pressing back I get again the correct size.
The fact is that the "middle" view is overlapped for 44 points by the navigation bar and I'm not able to make it the correct size except for hardcoding its size and I don't want.
The view autoresizing mask is blocked by IB because is the one of the file's owner. The status bar style is blck opaque.
Do you have some hints for me?
THX, Andrea

Was it helpful?

Solution

Try setting the property to YES in the second view instead of the first view.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top