views:

42

answers:

1

Hello,

Trying to implement the following behavior on an iPad.

I have a map-centric application which uses a tab-bar interface. The tabs at the bottom allow the user to choose between looking at the various different types of points that are marked on the map (e.g, think of the tab-bar items "food", "lodging" and "gas", where the "food" tab shows a listview of all the restaurants in the area, and so on).

The top half of the screen should always show the map. The bottom half of the screen is what should be controlled by the tab bar. However, there needs to be one tab on the tab bar that will make the map full-screen (not covering the tab bar itself, but covering everything else).

My impulse is that what I need is a map-view which always covers the whole screen, and then a tab-bar-controller that controls a view which sits on top of the map view, and then when the user selects the full-screen-map tab, the content view just gets hidden. But how do I actually do that?

Thanks!

+1  A: 

I would go so far to say that this barely possible using a standard UITabBarController. Instead, you should use the UITabBar directly in your interface and then link the actions of the items directly to your root view controller. This controller should then lay out the content area accordingly. This could be done quite easily by giving your nib a structure like this:

- ViewController
- View
   - View // place contents here
   - TabBar
      - Item1 // link action to ViewController
      - ...

Depending on how generic you want your solution to be, you could also implement a custom subclass of UITabBarController that does the custom layout. The above solution is the simplest and might require the least code.

Max Seelemann
I was hoping that wouldn't be the case... In more specific terms, what I'm doing here is updating an app written by someone else for the iPhone, giving it a new iPad interface... I think rewiring the whole tab bar interface might end up being a bit of a logistical nightmare.
DanM
There always are hacky solutions. If you have a very specific app and want to adjust it, you might find a hack that makes it easier for you. This, however, is not a clean solution ;)
Max Seelemann