Reputation: 5666
In an iPad app I'm working on I have this 'unusual' view hierarchy:
If I set mastercontroller
not to show the UINavigationBar
of the UINavigationController
, the UI is fine (only the status bar is shown).
After I try to push the detailcontroller
into the UINavigationController
(this time I want the bar to be show), the navigation bar appears translated on y axis (it is frame shows that its origin is (0,20) and 20 is the height of the status bar, right?...)
And when I return to the mastercontroller
, the bar is still there, translated. This is what I get:
Any clue on how can I solve this?
Upvotes: 0
Views: 444
Reputation: 10065
The root of the problem is that you are mixing controller hierarchies with view hierarchies.
Assuming that maincontontroller is a normal view controller, I would move your uinavigationcontroller up to be its sibling. That way, you don't need to workaround anything.
If a UINavigationController doesn't have a parentViewController, it basically assumes it's in the window.
Upvotes: 2
Reputation: 5666
I found a solution. Like amattn said I had to simplify the hierarchy, but this can't be done so easily since I have the constraint to make the topview always visible and being able to rotate.
The idea is to subclass UINavigationController and to put the view and its management into this subclass. This way an instance of this new controller can be applied directly to the main window and other controllers can be pushed in it.
Upvotes: 1