I am launching my app (iPhone and iPand) in landscape mode.
I found that frame for iPad frame changes in viewDidAppear , than the one in viewWillAppear.
IOS IPAD 5.1 simulator
In viewWillAppear it is 0.000000 20.000000 768.000000 1004.000000.
while ,In viewDidAppear it is 0.000000 0.000000 748.000000 1024.000000
IOS IPAD 6.0 simulator [but quite supprised with ios 6 ipad simulator]
In viewWillAppear it is 0.000000 0.000000 748.000000 1024.000000
while ,In viewDidAppear it is same as viewWillAppear.
So, can I set frame for my subViews in viewDidAppear? as here is get the perfect frame.
For iphone the results are same in both the methods 20.000000 0.000000 300.000000 480.000000.
Why am I getting different behaviour in iPad and iPhone?
Info.plist has "Supported interface orientations" for Landscape left and Right and "Initial interface orientation" is set to landscapeLeft.
AppLaunch method is as follows:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.viewController=[[ViewController alloc] init];
self.window.rootViewController = self.viewController;
}
ViewController.m has the following methods
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(UIInterfaceOrientationIsLandscape(interfaceOrientation)){
return YES;
}
return NO;
}