I am developing iphone application in iOS7, i am facing problem in autorotate single screen in landscape mode programatically, while other screens remains in portrait mode. I am using Story board.
Asked
Active
Viewed 1,063 times
0
-
look @ this- http://stackoverflow.com/a/12728435/1537036 – Mumthezir VP Oct 17 '13 at 09:13
1 Answers
2
I used following and its working for me in both iOS6 and iOS7 also,try following way :
// Added method for Autorotation in you app delegate
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
//NSLog(@"AppDelegate -- supportedInterfaceOrientationsForWindow");
if([UICommonUtils isiPhone]){
return UIInterfaceOrientationMaskPortrait;
}else if(flagOrientationAll == YES){
return UIInterfaceOrientationMaskLandscape;
}
}
Add following in your view controller
// set flag "flagOrientationAll" to rotate only one view in your perticular view
-(void)viewWillAppear:(BOOL)animated
{
NSLog (@"webViewController -- viewWillAppear");
[super viewWillAppear:animated];
PlayWithWSWithLibAppDelegate *delegate = (PlayWithWSWithLibAppDelegate *) [[UIApplication sharedApplication] delegate];
delegate.flagOrientationAll = YES;
}
-(void)viewWillDisappear:(BOOL)animated
{
NSLog (@"webViewController -- viewWillDisappear");
PlayWithWSWithLibAppDelegate *delegate = (PlayWithWSWithLibAppDelegate *)[[UIApplication sharedApplication] delegate];
delegate.flagOrientationAll = NO;
}

Divya Bhaloidiya
- 5,018
- 2
- 25
- 45
-
for me UICommonUtils is showing error... can u tell me what is UICommonUtils or do i have to add any header class ? – amit soni Jan 08 '14 at 13:10
-
It is my class file in which I placed all common methods. like to check device type, rotation etc – Divya Bhaloidiya Jan 08 '14 at 14:26