tags:

views:

27

answers:

2

I have an application with a Tab Bar Controller that has three tabs.

In tab 1 there is a view (view1) with a button that when clicked transitions the user to a new view (view2) still within tab 1. However when this new view (view2) is loaded it covers my tab bar controller.

What is the best approach for me to take to still display tab bar controller as well as keep tab 1 highlighted?

A: 

How are you performing your "transition" to view2 from view1?

One solution is to use a UINavigationController as the root view controller for tab1, so view1 can display view2 by pushing it on the navigation controller. Alternatively, have view1 display view2 modally.

Either way should not cover your tab bar, and tab1 will still be selected (highlighted).

Shaggy Frog
Currently I am doing a transition like this:[self presentModalViewController:myViewController animated:NO];So it seems it is a modal and it expands the whole screen covering my tab bar. If there something in the load method I should do to make my tab bar visible or drawn over this? If this is the approach that I want to take?
helloJello
A: 

I think you are pushing the view as modal view if this is the case then the view will definitely cover your tab bar the other way to do this is push the view controller and this will not hide your tab bar.

Try to do it like:

[[self navigationController] pushViewController:viewContObject animated:YES];

Hope this helps,

Thanks,

Madhup

Madhup
Sorry I'm a newb and wasn't really aware that I could use a navigation controller with view other than table views. But I guess this makes sense. Is this approach that you would recommend taking when using a Tab Bar Controller based application? Where one tab will have a table and the other tabs may contain other functionality, ie. a search tab or/and map?
helloJello