Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

skunkworker

macrumors regular
Original poster
Sep 9, 2007
182
20
I've got a tab bar and it properly switches between view controllers.
But its only showing a half of the tab bar.
121qv7q.png
 
You can try what was mentioned above, but how are you creating the UITabController? in IB or in code? If its in code, there is something incorrect when you're setting the frame.
 
You can try what was mentioned above, but how are you creating the UITabController? in IB or in code? If its in code, there is something incorrect when you're setting the frame.

I'm creating it in code.
Code:
 [self.view addSubview:tabBarController.view];

But it seems like the view is not correctly sized as its getting pushed from another view.
 
I'm creating it in code.
Code:
 [self.view addSubview:tabBarController.view];

But it seems like the view is not correctly sized as its getting pushed from another view.

What is this view you are adding your tab bar controller's view to?

Why don't you make your tab bar the "root" of your hierarchy?
 
What is this view you are adding your tab bar controller's view to?

Why don't you make your tab bar the "root" of your hierarchy?

Cause my root view is a navigation controller.

Its almost as if the navigation bar is pushing down the tabbarcontroller.
 
You're not using the tab bar controller correctly. *It* should be your root view and your UINavigationController should be added as one of the view controllers for the tab bar controller (e.g. for the first tab).

Well then i need to rethink how this particular part of my application operates.
 
Just a suggestion:

Instead of adding the tab bar controller in code, try making a hidden one in interface builder and when you want it to appear use this:
Code:
 [TabBarControllerPointerName setHidden:NO];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.