views:

624

answers:

1

Probably easiest to explain by example:

In the Facebook 3.0 app, if you click on a friend, it shows "Wall | Info | Photos" in a UISegmentedControl, which acts like a UITabViewController. If you then click on, say, a photo, it pushes a sub view onto the UINavigationController stack, which slides the UISegmentedControl (and parent view) to the left. How would I structure my app design to facilitate this?

I.e. it may be:

  • UIViewController (with UISegmentedControl containing three items (representing three views)
  • ---UINavigationController
  • -------UIViewController (i.e. Wall)
  • ----------UIViewController (i.e. Comments on a post, gets pushed onto the stack)
  • ---UINavigationController
  • -------UIViewController (i.e. Info)
  • etc...

The question is, if I design it as above, how will I get the UISegmentedControl to slide away with the Wall view if the user clicks on the comments to a post (which pushes the comments view onto the navigation controller's stack)? This seems non-optimal.

Or, I could place the UISegmentedControl inside each of the UINavigationControllers as a subview, but I'm not sure how I would move it between UINavigationControllers as the user switches between "tabs" while maintaining state...

Is there an easier way to design the layout of views?

A: 

Have a look at the Three20 lib by Joe Hewitt. It's hosted on GitHub.

Neal L