I am working in universal app which works fine till ios 5 but in ios 6 there is orientation problem. My app is only in portrait mode. The problem is when my ipad is in landscape mode and than if i start my app than the orientation does nt change to protrait. So please help me with some code so that i force my app to be in protrait mode only independent of the orientation of device before the app launches
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
This is happening because Apple Has changed the Way of managing the Orientation of UIViewController. In Ios6 Oreintation handles Differently .in iOS6 containers (such as UINavigationController) do not consult their children to determine whether they should autorotate. By default, an app and a view controller’s supported interface orientations are set to UIInterfaceOrientationMaskAll for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown for the iPhone idiom.So device getting orientation changed by default.
So Need To Perform Some Steps.
1 -Set the Orientation From Here
2 -Place This Code in FirstViewController added to the RootViewController
** Put below methods in ViewController,Introduced In IOS6 Allow Oreintation Change**
First we have to set supported orientations in Targets->Summary...
In iOS6.0 shouldAutorotateToInterfaceOrientation Method is deprecated.So,instead of this method we have to use shouldAutorotate Method..
And with the method supportedInterfaceOrientations we have to set which orientations we want like UIInterfaceOrientationMaskAll if we want all orientations
In your
ViewController.m
you will have to define your supported orientation. In IOS 6 this is the method which handle the supported orientation.UIInterfaceOrientationMaskAll
means it will support all orientation ofview
.Also read the Apple Doc - Doc about Orientation