views:

201

answers:

1

I'm curious what the best method is for managing the traversal through several views without burning screen space using a navigation bar.

As an example, assume I have four UIView's with associated UIViewController's:

1: Top level menu (invokes A or B.1)
1.A: Menu selection A (return to 1)
1.B.1: Menu selection B, part 1 (invokes B.2)
1.B.2: Menu selection B, part 2 (return to A)

First, I'm unsure if a navigation controller is appropriate when I am not using a navigation bar. As an alternative, I am considering implementing a custom UIViewController that holds view controllers and acts as a screen manager.

Thoughts?

+1  A: 

You can always hide the navigation bar using setNavigationBarHidden:animated:

Other than that it depends on what type of app you are building. Yours sounds like something that could use a Tab Bar, although that doesn't solve your problem of taking up screen space.

XCode's templates offer another way to do it - try looking at a new project that is a "Utility" app. It shows how you can seamlessly switch between a couple of different screens.

bpapa
I ended up going with the UINavigationController. In the setup for my app all views are loaded from xibs where each xibs has a background image in a UIView and various other elements overlayed. I've disabled the status bar (and hidden the navigation bar) and I'm seeing a strange issue where my background image is offset by 10px in the y axis, however, all other elements added in IB seem to be in place. I've corrected by writing a wrapper that adjusts for each view controller as it's pushed onto the navigation controller. Is there something I've done wrong?
Jason George
Experiment with [UIScreen mainScreen].applicationFrame
bpapa
Hmm, I compared [UIScreen mainScreen].applicationFrame to the UINavigationController.view.frame and they are identical (0, 0, 320, 480). Any other places I could look?
Jason George
I recently discovered the problem was in interface builder. In addition to disabling the status bar within the program, each xib needed to have the status bar disabled and the xib size adjusted to 320x480.
Jason George