The problem that you will encounter is that if you use a navigation controller, the title of each page will overlap with your custom navigator. If your navigator contains the logo or name of your application, this is clearly unacceptable.
You can set the title of each view in the navigation stack to be empty, but some views force a title that you canโt do anything (such as a photo picker). Thus, you can create an alternative image on the navigation bar with the same color or design as the logo on the navigation bar, but with an empty area to make room for overlay headings.
To switch navigation images as you like, add a property to the application delegate to save the name of the navigation image and replace the first line of the first example with the above two:
YourAppDelegate* theApp = (YourAppDelegate*)[[UIApplication sharedApplication] delegate]; UIImage* image = [UIImage imageNamed:theApp.navBarName];
Then, in the first view of the controller that you click on the navigation stack, do something like this:
- (void)viewWillAppear:(BOOL)animated { YourAppDelegate* theApp = (YourAppDelegate*)[[UIApplication sharedApplication] delegate]; theApp.navBarName = @"navBar_plain"; }
Then, in the root view controller, do the same, but specify your navigation image with a logo, and it will be restored when the user navigates to it, and there is no contradictory name.
Oscar Apr 14 '11 at 7:25 2011-04-14 07:25
source share