Search Issue Tracker

Fixed in 2017.2.0f3

Fixed in 5.4.X, 5.5.X, 5.6.X, 2017.1.X



Found in


Issue ID




[iOS] Changing the screen orientation via a script sometimes results in corrupted view on iOS 10



When the orientation of the screen is changed via a script (with Screen.orientation) on iOS 10 devices, sometimes the screen remains in portrait orientation, but the game view gets flipped and goes over the edge of the screen and leaves black area in the bottom part of the screen.

Steps to reproduce:
1) Open the attached project.
2) Build 'MainScene' for iOS.
3) Run on an iOS 10 device.
4) Press the 'Switch to landscape' UI button.

If the button is clicked 2-3 seconds after launch - the rotation should fail - black area appears at the bottom of the screen, half of the game view is not visible. If it does not, quit the app completely, re-launch it and repeat step 5). This occurs with both Metal and OpenGLES on iOS 10.

Reproduced on:
5.5.0b5, 5.4.1p3, 5.3.6p6

iPhone 7 iOS 10 - reproduced
iPhone 7 iOS 10.1 - reproduced
iPhone 7 Plus iOS 10.0.2 - reproduced
iPhone 5 iOS 10 - not reproduced
iPad Mini 2 iOS 10 - not reproduced
iPhone 5S iOS 9.2.1 - not reproduced
It should also be reproducible on iPhone 6.
iPhone 6S iOS 10.2 - reproducible


Fixed in 2017.1.0b10, 5.6.2p1, 5.5.4p1, 5.4.5p4

Comments (94)

  1. 4b38dae05c4e294ee8362ec988231815?d=mm


    Dec 14, 2016 22:52

    I have noticed that the severity of this issue is 3, meaning "workaround is possible", which absolutely not the case.
    So please increase the severity of this issue, and fix it asap. It is really a terrible bug!

  2. 022c156d76ef8c3212a324c252fa9fbe?d=mm


    Dec 13, 2016 21:34

    None of the posted workarounds works for our situation, but we came up with one that does!

    Here's a link to the basics of our current workaround:

    Context: Our app starts in Portrait, has autorotate disabled, and we explicitly force LandscapeLeft upon loading a "level" -- this step of explicitly changing from Portrait to LandscapeLeft causes the bug to appear almost 50% of the time on iOS 10.

  3. 85916f2e42ab5a983e1943f37437c764?d=mm


    Dec 12, 2016 13:31

    Though, this causes wired auto rotation for our users when they bring our game front Background to Front, That's wired, and I dont know if Apple will reject our app because it behaves strange, just like a bug.

    Hope this bug would be fixed soon.

  4. 85916f2e42ab5a983e1943f37437c764?d=mm


    Dec 12, 2016 13:26

    Thanks to FSPARK's workaround, but the code will till crash our app.
    After digging in our game, I found the app only crashes in this situation:
    (Our game only supports landscape left and right)

    1. Open your game
    2. Get in any scenes which is somewhat complex.(Very simple scenes does not crash in our game)
    3. Lock your iphone.
    4. After ApplicationDidEnterBackground, unlock your iPhone with portrait orientation;
    5. Game crash.

    And with FSPARK's code, the app still crash when you set the device orientation to the same when you lock your iPhone. The screen do not auto rotate to wakeup Unity.

    So we changed the code a little, to always rotate the app to the opposite landscape, and the app does not crash any more. Here's the code:

    UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
    NSNumber *value = [NSNumber numberWithInt:UIDeviceOrientationLandscapeRight];

    if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft){
    value = [NSNumber numberWithInt:UIDeviceOrientationLandscapeLeft];
    }else if(interfaceOrientation == UIInterfaceOrientationLandscapeRight){
    value = [NSNumber numberWithInt:UIDeviceOrientationLandscapeRight];

    [[UIDevice currentDevice] setValue:value forKey:@"orientation"];

  5. 13db2970a528603271106a85e6e5a55f?d=mm


    Dec 08, 2016 20:33

    if you dont vote for it, it wont be fixed. Just commenting here doesnt help

  6. 022c156d76ef8c3212a324c252fa9fbe?d=mm


    Dec 08, 2016 17:40

    Unfortunately, we just got our first submission rejected by Apple over this.

    Since this issue has been around since iOS 10 shipped, I guess we will have to try FSpark's workaround!

  7. 5ba75621e96f1b44463991d93a933fe6?d=mm


    Dec 06, 2016 15:40


  8. D4b5154ffde92a67902bc4e8bc08a7f6?d=mm


    Dec 06, 2016 14:11

    Everyone please vote, don't just comments, there are only 9 votes left to raised this issue to Unity

  9. 5ba75621e96f1b44463991d93a933fe6?d=mm


    Dec 05, 2016 22:36

    Does anybody have found a proper fix for it. Have unity fixed this issue in some version above 5.4.x series? I am also stuck in this. It should have been answered or handled till now.

  10. 4b38dae05c4e294ee8362ec988231815?d=mm


    Dec 01, 2016 11:27

    Got the same issue using Unity 5.4.2f2.
    It's a really severe issue for us. Please fix.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.