just.dont.do.it (do not set frame) !!!
The most simple and clean technique is:
YourAppDelegate.h:
@property(nonatomic,retain) UITabBarController * tabBarController;
YourAppDelegate.m:
@synthesize tabBarController;
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.tabBarController = [[[UITabBarController alloc] init] autorelease];
UINavigationController *viewController1 = [[[UINavigationController alloc] initWithRootViewController:[[[UIViewController alloc] init] autorelease]] autorelease];
UINavigationController *viewController2 = [[[UINavigationController alloc] initWithRootViewController:[[[UIViewController alloc] init] autorelease]] autorelease];
self.tabBarController.viewControllers = @[viewController1, viewController2];
self.tabBarController.customizableViewControllers = nil;
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
And everything will be OK. Frames, rotation, autoresizing, on iPhone, iPad, etc etc.
Btw, you can create the new project with "Tab Bar application" template in Xcode and see how Apple does it
and .. (advice, that can help you in future)
UITabBarController must be on the top of view hierarchy (directly on the UIWindow) for correct rotating and etc, my sample code includes it (it can save you some time in future)