hope you will be fine and doing your best.
I am getting a problem in upSideDown Orientation
in my iOS 6
, while I think I am doing everything perfect, but I don't know why it is not working for me. I am sharing my problem with you so to get any solutions.
What I have done so far:
a) In xcode project Summary tab, I have enabled all the 4 orientations.
b) I have added piece of code (written below) in all of my controller classes.
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
but still the upSideDown Orientation
is not working
Thanks in anticipation.
Older iOS Versions – How to Turn Off iPhone 6 Portrait Lock Step 1: Swipe up from the bottom of your iPhone screen. Step 2: Tap the circular lock icon at the top-right corner of this gray menu. Portrait orientation lock is turned off when that button is gray.
Swipe up from the bottom edge of your screen to open Contol Center. Tap the Portrait Orientation Lock button to make sure that it's off. That's it. Your iPhone or iPod Touch should rotate properly now.
Turn on Auto rotate. You'll find this setting in the Quick Settings menu. If you see Auto rotate highlighted in blue, then auto rotate is turned on. If you don't see Auto rotate, but there's a Portrait icon instead, auto rotate is disabled.
I have found its solution.
We need to make a separate class of UINavigation Controller
type. In .m
file add the following methods
// Deprecated in iOS6, still needed for iOS5 support.
// ---
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
// return (interfaceOrientation == UIInterfaceOrientationPortrait);
return YES;
}
// iOS6 support
// ---
- (BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAll;
}
Now assign this newly created class to your Navigation Controller
in story board. Also add the .m
file of this class in 'Project -> Build Setting -> Compile Sources'. Run the project and it will support and perform all the orientations including upSideDown
.
I hope it will help you all.
Regards
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With