Can Anyone explain me how to give the Support for Landscape and Portrait orientations in iOS 7 iPad using auto layout or programatically .
I have tried with @"will rotate Method" programatically and also auto layouts.. but both these are not working Properly for.
Don't know where I m Making the mistake
Please check this below code for reference and correct me
-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
NSLog(@"Landscape left");
NSLog(@"Landscape left : %@",LoginBackgroundView);
LoginViewObj.loginBackgroundImage.frame= CGRectMake(0 , 0, 1024, 768);
LoginViewObj.LoginBackgroundView.frame =CGRectMake(346, 228, 337, 300);
} else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
NSLog(@"Landscape right");
LoginViewObj.loginBackgroundImage.frame= CGRectMake(0 , 0, 1024, 768);
LoginViewObj.LoginBackgroundView.frame =CGRectMake(346, 228, 337, 300);
} else if (toInterfaceOrientation == UIInterfaceOrientationPortrait) {
NSLog(@"Portrait");
NSLog(@"potrait : %@",LoginBackgroundView);
LoginViewObj.loginBackgroundImage.frame= CGRectMake(0 , 0, 768, 1024);
LoginViewObj.LoginBackgroundView.frame =CGRectMake(0, 330, 337, 300);
} else if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"Upside down");
LoginViewObj.loginBackgroundImage.frame= CGRectMake(0 , 0, 768, 1024);
LoginViewObj.LoginBackgroundView.frame =CGRectMake(0, 330, 337, 300);
}
}