Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios 8 Orientation Issue

my application, developed in iOS7, has a forced orientation base on device: iphone -> portrait Ipad -> landscape

With iOS8, if my apps on ipad starts in portrait mode, it will show the app in landscape but the result is:

enter image description here

How to fix iOS 8 orientation?

like image 288
Alessio Crestani Avatar asked Sep 02 '26 04:09

Alessio Crestani


2 Answers

I'm not sure if I can answer my own questions, but I have resolved the issue using

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

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

like image 100
Alessio Crestani Avatar answered Sep 04 '26 19:09

Alessio Crestani


- (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;

}

like image 35
Abdul Yasin Avatar answered Sep 04 '26 19:09

Abdul Yasin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!