How do I keep the top view of the application as a whole? Through different navigation controllers?

I am developing an application in which I am using a navigation submenu, for example in a facebook app: Screen Shot of app skeleton

I want to keep this bar at the top through the app and make the UINavigationControllers swap in and out of it for different sections of the app for Item1 ... ItemN.

How can i do this?

+3


source to share


3 answers


I solved this problem by using child view controllers in a "central" view. I just made the top most persistent menu subordinate, which sits on top of the child's controller view.



0


source


Just add it to your AppDelegate window:

[[[UIApplication sharedApplication] delegate].window addSubview:yourView];

      



Honestly, you should pass a delegate that comes from sharedApplication

+2


source


I solve this using a custom container view controller. Mine rootViewController

is just a container controller that contains my menu and a normal view controller. This allows me to do whatever I want with the menu, but just slide the menu off the screen and the child view controller acts as if it were in control of everything.

"Implementing a Container Controller" is a section in UIViewController

Class Reference
and contains some useful information on how to complete the task. There are also many good videos from Apple at WWDC when they were introduced in ... 2011?

Edit: Added information about custom view controllers.

+1


source







All Articles