I want to show one view in landscape forcibly. All other views are in portrait.
I tried the code below to show landscape mode while coming from portrait mode. It is not working.
How can I do this?
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ((interfaceOrientation == UIInterfaceOrientationMaskLandscape) ||
(interfaceOrientation == UIInterfaceOrientationMaskLandscapeLeft) ||
(interfaceOrientation == UIInterfaceOrientationMaskLandscapeRight))
{
return YES;
}
return NO;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
-(BOOL)shouldAutorotate{
return NO;
}
-(NSInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}