I am developing an iPhone application in which i have to change the oreintation to landscapeleft and landscaperight.Its working in iPhone 4 but not in iPhone 5.Please let me know how to do for ios 6.The piece of code i am using is below.
Thanks.
I am developing an iPhone application in which i have to change the oreintation to landscapeleft and landscaperight.Its working in iPhone 4 but not in iPhone 5.Please let me know how to do for ios 6.The piece of code i am using is below.
Thanks.
Add this code
-(NSUInteger)supportedInterfaceOrientations
{
return (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight);
}
It worked for me Hope it helps you!
EDIT
Also add this code
- (BOOL)shouldAutorotate
{
return YES;
}
It doesn't work as nicely as it was in IOS6, I had the same issue.Since they introduced new rotation, but the old way of running navigation controller(because my app needed to support 4.3 as well) does make it very hard.
Read my question and solution should be able to help you:
Try this
-(BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeRight;
}