-1
-(NSUInteger)supportedInterfaceOrientations
{           
    return UIInterfaceOrientationMaskPortrait;
}

-(BOOL)shouldAutorotate
{
    return NO;
}

I just want to enable landscape orientation in only one view of my app. Other view must support the portrait mode only. But for iOS 6 its autorotate even I am using the latest methods of iOS 6. Expecting correct suggestion.

3
  • check this link stackoverflow.com/questions/12565188/…
    – Rushabh
    Feb 28, 2013 at 7:34
  • thanks.. but Used the method in the link still it is supporting orientation. I want portrait orientation except one view that support two landscape and Portrait.
    – Rahul
    Feb 28, 2013 at 9:05
  • No its just not working.. I hav tried it earlier.. The main problem is in iOS 6.
    – Rahul
    Feb 28, 2013 at 12:36

1 Answer 1

0

For Portrait Only Orientation , try below method

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}

- (BOOL)shouldAutorotate {
    return FALSE;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.