views:

491

answers:

1

Hey.

My customer wants a design-change, but I just can't figure out how to do this!

The app currently have a UITabBarController shifting between some UINavigationController's. My customer wants to use a UIToolBar with a UISegmentedControl shifting between the controllers instead.

I want to keep the UITabBarController, because that takes care of everything regarding loading and shifting views, but I want the UIToolBar to act as the UITabBar instead of the UITabBar!

I have allready figured out that I will need a custom UITabBarController and possibly a custom UIToolBar as well.

But I have absolutely no idea of where to start, so it would be great if somebody could give me a pointer as to where to start.

Top part to act as bottom part.

Thank you.

+1  A: 

If I understand your requirements correctly, you want to have a UIToolbar at the bottom of the screen that has a UISegmentedControl that replaces pressing UITabBarItem's to switch between different views and view controllers? Assuming this is true I'd start with a custom UIToolbar class, say SegmentedControlToolbar that mirrors the basic behaviour of UITabBarController and UITabBar to add items to a segmented control, attach view controllers to each segment, and finally handle presses for each segmented control change to actually switch views.

petert
This turned out great in the end, I hid the `UITabBar` under the `UIToolBar`, and hooked up a couple of selectors. Thank you!
Emil