Search Unity

iPhone X Letterboxing

Discussion in 'iOS and tvOS' started by Lemo76, Dec 20, 2017.

  1. Lemo76

    Lemo76

    Joined:
    Aug 7, 2012
    Posts:
    174
    I can't seem to get my app working full screen in iPhone X, it always goes to a letterbox.
    I am using Unity 5.6 compiling to X-code 9.2.



    If there is any simple fix I'm missing that would be awesome.

    Thank you!
     
  2. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    What is your Launch screen type in Player Settings?

    I use type None on Unity 5.6.4 with Xcode 9.1 and get full screen on iPhone X.
     
  3. Lemo76

    Lemo76

    Joined:
    Aug 7, 2012
    Posts:
    174
    I've checked and it's already been set to None:

     
  4. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    I don't show the Unity logo.
     
  5. Ham-Dongki

    Ham-Dongki

    Joined:
    Dec 22, 2017
    Posts:
    2
    launch screen type set to "default".
     
    kokteylgaming and Lemo76 like this.
  6. Lemo76

    Lemo76

    Joined:
    Aug 7, 2012
    Posts:
    174
    That fixed it, thanks!
     
  7. kokteylgaming

    kokteylgaming

    Joined:
    Nov 2, 2016
    Posts:
    7
    It did what I needed, thank you so much!
     
    Ham-Dongki likes this.
  8. unity_L6xmfNFURMtf4Q

    unity_L6xmfNFURMtf4Q

    Joined:
    May 29, 2018
    Posts:
    3
    Hey does anyone has an idea how to solve the notch problem and safe area on iphonex. I have provided a screenshot. It is working fine and full screen on any iphone devices including ipad but when i tested it on iphonex the character is hidden on the corner and the health bars was covered by the notch of the iphonex. Is there a settings on the unity players settings that could solve the issue or is there on xcode ?. Thank You.
     

    Attached Files:

  9. loughrank

    loughrank

    Joined:
    Jul 12, 2013
    Posts:
    7
    I've set my "launch screen type" to "default", but I'm still getting the letterbox on iPhoneX: Unity 2017.4 + XCode 9.2.

    There appears to be conflicting information on this thread: one user says setting "launch screen type" to "none" allowed the iPhoneX to display fullscreen, while other users say setting it to "default" did the trick. I wonder if something has been updated in the Unity Editor that's causing this confusion?

    UPDATE: With my combination (2017.4 + XCode 9.2), setting the launch screen type to "none" allowed the iPhoneX to display fullscreen.
     
    Last edited: Aug 1, 2018
  10. loughrank

    loughrank

    Joined:
    Jul 12, 2013
    Posts:
    7
    You can make use of UnityEngine.iOS.DeviceGeneration.iPhoneX

    Here's a script that you can attach to your UI elements to adjust their Y position(s):

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class CheckIPhoneX : MonoBehaviour {
    6.  
    7.     void Start () {
    8.  
    9.         bool deviceIsIphoneX = UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPhoneX;
    10.  
    11.         if (deviceIsIphoneX) {
    12.  
    13.             Debug.Log("adjusting for iPhone X");
    14.  
    15.             RectTransform myRectTransform = GetComponent<RectTransform>();
    16.  
    17.             // get current X/Y
    18.             float pX = myRectTransform.anchoredPosition.x;
    19.             float pY = myRectTransform.anchoredPosition.y;
    20.  
    21.             // change value(s) to adjust offset
    22.             pY -= 100;
    23.  
    24.             // set new values
    25.             myRectTransform.anchoredPosition = new Vector2(pX,pY);
    26.         }
    27.  
    28.     }
    29.  
    30. }