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. 354e882a407bfcd2ebb89e43d26c5c63?d=mm


    Nov 30, 2016 17:56

    In case this helps anyone - I raised a similar issue where the iOS device (iOS 10) the UI appeared locked and display distorted on resuming app after extended sleep (see ).

    The quick workaround I used was to modify the Unity generated

    - (void)applicationWillEnterForeground:(UIApplication*)application
    ::printf("-> applicationWillEnterForeground()\n");

    // applicationWillEnterForeground: might sometimes arrive *before* actually initing unity (e.g. locking on startup)
    // if we were showing video before going to background - the view size may be changed while we are in background
    [GetAppController().unityView recreateGLESSurfaceIfNeeded];

    // Bug workaround:
    // On returning from device sleep mode, Unity UI is lock and will not respond
    // If the device is rotated, Unity will 'wake up'
    // So force landscape orientation to wake up Unity
    [[UIDevice currentDevice] orientation];
    NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
    switch( [[UIDevice currentDevice] orientation] )
    case UIDeviceOrientationPortrait:
    value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];

    case UIDeviceOrientationPortraitUpsideDown:
    value = [NSNumber numberWithInt:UIInterfaceOrientationPortraitUpsideDown];
    case UIDeviceOrientationLandscapeLeft:
    value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];

    case UIDeviceOrientationLandscapeRight:
    value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight];
    // setting to portrait does not work
    // value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
    // but forcing the device into landscape mode and then allow it to auto-correct works
    value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];
    [[UIDevice currentDevice] setValue:value forKey:@"orientation"];

  2. 3e1043a130b785a00a76bf2538600b31?d=mm


    Nov 30, 2016 08:42

    Reproduced this issue in iphon5s, iphone6, etc. with Unity 5.3.4f1

    pls fix..

  3. Fba2e8386dbb30f45bb601de037fd29a?d=mm


    Nov 23, 2016 01:57

    On a current game we are developing we are seeing a solid color full screen when we run on new iPhone 7 Plus. Have people seen this problem manifest as it hanging with the background color filled in but before the full opening scene has been rendered?

  4. Cb24cf86df5d9e36d9f064a13cea28b3?d=mm


    Nov 15, 2016 04:41

    Workaround: In the info.plist file, go to "Supported Orientations" and add portrait (I also move it to index 1 instead of 0). This will fix the screen issue but mess the splash screen up on some devices. This fix worked for me, so from what I can tell if you make a portrait version of your Splash Screen art (Rotate it 90 degrees).

    I added both images to the splash screen in Unity Player Editor and they appeared in my Xcode project file. Go to "Launchscreen-iPhone.xib", once you have selected a canvas and the XIB has loaded, click the bottom where the screen measurements are. This will open the device and orientation selector menu make sure you have it set to portrait.

    Now head to the hierarchy and and create a new View and call it something like "ViewP" (you can add things to the xib by using the toolbox in the bottom right, for those who don't use Xcode), on the right enter the attributes selector, scroll to the bottom where it says "Installed", uncheck that and hit the small plus symbol to the right, if you have the view set to portrait, just click Add Variation, this will set the view to only activate in portrait screen.

    From there add an Image View and change the "Image" option in the attributes selector to your portrait image. I'm not 100% on what I did with the constraints but essentially what you want is to have it stay the same through all the different screen sizes, from there you should be good!.

    Hope this helps folks. Cheers.

  5. Cb24cf86df5d9e36d9f064a13cea28b3?d=mm


    Nov 15, 2016 02:10

    Having the same issue with + devices in Unity 5.4.2f2 personal edition. Currently testing a work around in Xcode. Will re-comment if the test is successful

  6. 13db2970a528603271106a85e6e5a55f?d=mm


    Nov 14, 2016 05:01

    Guys please vote for this to be solved, dont just comment

  7. 04e20b857efa08ac303dea5b90ba318f?d=mm


    Oct 30, 2016 19:45

    Having the same awkward issue!

  8. 13db2970a528603271106a85e6e5a55f?d=mm


    Oct 25, 2016 12:01

    Please fix, this is a stupid issue that should not exist

  9. B0f1b55d4c6bc5d9d2c9b3bf029c04e0?d=mm


    Oct 21, 2016 21:14

    Also does a mini glitch sometimes on Android.. FIX this ASAP!!!

  10. 0549510b560ab48d5436aa759e6c5467?d=mm


    Oct 21, 2016 19:22

    Show stopper for VR apps!!! 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.