I’m trying to reposition the tab bar in a UITabbarController. I know it’s not a great idea but that’s what I was asked to do. I managed to move the tabbar to the top of the screen with this:
self.tabBarController.tabBar.frame = CGRectMake(0, 0, 768, 68);
and it works great. Unfortunately, the content view is not repositioned accordingly.
After I reposition the tab bar, I add the content view and try to adjust it manually, but it doesn’t have any effect:
self.tabBarController.viewControllers = [NSArray arrayWithObjects:
[[[HomeViewController alloc] initWithNibName:nil bundle:nil] autorelease],
nil];
// dummy values for testing.
self.tabBarController.selectedViewController.view.frame = CGRectMake(0, 69, 10 , 10);
What am I doing wrong?
How about moving tabBarController.view’s frame down 68 pixels?
You’d have to set the y-coordinate of the tabBar’s frame to -68 instead of 0.
If you can’t see the tabBar, you might have to set tabBarController.clipsToBounds to NO.
Haven’t tried this though.