Ios 8 Orientation issue

my app developed in iOS7 has forced orientation on device: iphone -> iPad portrait -> landscape

In iOS8, if my apps on ipad start in portrait mode, it will show the app in landscape, but the result is as follows:

enter image description here

How to fix iOS 8 orientation?

+3


source to share


3 answers


I'm not sure if I can answer my own questions, but I solved the problem using

[self.window setFrame:[[UIScreen mainScreen] bounds]];

      



at the end of the method (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

.

+6


source


- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {



if ([window.rootViewController isKindOfClass:[UINavigationController class] ]) {

    if ([[window.rootViewController presentedViewController]
         isKindOfClass:[SignatureViewController class]]) {
        return UIInterfaceOrientationLandscapeRight;
    }

    return UIInterfaceOrientationMaskPortrait;
}

    return UIInterfaceOrientationMaskPortrait;

      



}

+4


source


My problem was with the UIWindows frame that was going minus. So did the code as shown below in MyViewController - (NSUInteger) supported method InternfaceOrientations

[[UIApplication sharedApplication] setStatusBarHidden:NO];

[self.view setFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height)];

[appDel.window setFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height)];

      

Try it.

0


source







All Articles