Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Bug] [iOS 10] Screen.orientation sometimes results in corrupted view

Discussion in 'iOS and tvOS' started by qsw745, Nov 28, 2016.

  1. qsw745

    qsw745

    Joined:
    Nov 14, 2016
    Posts:
    6
    When the orientation of the screen is changed (from ScreenOrientation.Portrait to ScreenOrientation.Landscape) 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.

    sometime error:
    WechatIMG78.jpeg
    sometimes right:
    WechatIMG79.jpeg

    ISSUE TRACKER: https://issuetracker.unity3d.com/is...sometimes-results-in-corrupted-view-on-ios-10

    Anybody has solution to quick fix in iOS code? Please help me, thank you!!!
     
    MechEthan likes this.
  2. MechEthan

    MechEthan

    Joined:
    Mar 23, 2016
    Posts:
    166
    (Reposting my comment here.)

    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: https://gist.github.com/Ethan-VisualVocal/286ebae00eb3100885b19c90e8b9ff52

    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. qsw745

    qsw745

    Joined:
    Nov 14, 2016
    Posts:
    6
    Thank you
    I will have a try
     
  4. Vaidas_B

    Vaidas_B

    Unity Technologies

    Joined:
    Jun 17, 2016
    Posts:
    18
  5. aytek_unity

    aytek_unity

    Joined:
    Feb 20, 2019
    Posts:
    1
    I am still getting this in Unity 2020.2.1f1. I can't vote for the issues as it is marked as resolved.
     
  6. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
    This is more of an iOS issues as far as I can tell, because this issue also used to happened to non-Unity apps that has a storyboard as the launch display. The issue went away in later iOS versions, although no release notes from Apple acknowledged the issue or mentioned that the issue was fixed.
     
  7. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    225
    +1, this feature doen't work in 2020