iPhone 5 Landscape Splash is missing!

Why a bug? Because I allow rotations and the rotated screen looks like this:

Who puts this screen up? Looks like the iphone doesn’t support splash screen rotations so where is this rotation coming from?

Looks like this is a UE4 image view that covers initialisation (which is interesting, because I have another bug logged where there’s a frame black screen that I can’t fix prior to my own UI code kicking in).

It’s possible to fix the problem I have by adding:

-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow : (UIWindow *)window
{
    //IPhone 4/5 models do not have landscape launch images so
    //we fix them in portrait mode while showing the splash screen.
    if (FPlatformMisc::GetIOSDeviceType() <= FPlatformMisc::IOS_IPhone5S)
    {
        if (GShowSplashScreen)
        {
            return UIInterfaceOrientationMaskPortrait;
        }
    }
    
    return UIInterfaceOrientationMaskAll;
}

Whatever the final return value is (MaskAll in this case) will override your project settings. I’m not sure how to read the project settings in order to return something appropriate and create a valid pull request.

The problem happens after the OS splash screen. UE4 puts up its own splash screen to cover further loading. This view allows the plist defined orientations but only has the single portrait image so when you rotate the screen it rotates and clips as shown.

To repro:

  • Enable all orientations in the iOS settings.
  • Add a splash screen for iphone5 that isn’t black.
  • Build, launch and rotate the screen during the loading process

I’m verifying in 16, will post a project once verified.

The two solutions I see (I’m not an iphone native so this is shooting in the dark) are 1) The code I copied above but with the default return coming from the plist settings or 2) preventing the UIImageView that UE4 creates from allowing rotations.

  1. works for me, but becomes a weight around my neck that ties my project to a modified engine something I’d prefer to avoid in the long run as it adds a barrier of entry to onboarding.

Hi the onecalledtom,

Can you provide me with a way to reproduce this in a completely blank mobile project and deploying to any iOS mobile device?

I looked at an old bug internally related to the iPhone 5 and screen orientations, and the engineer mentions, “IPhone (except maybe 6+) only has a single splash screen, you have to modify your splash screen to be portrait or landscape yourself. This is as expected.”

So I just checked to confirm, and behavior you are reporting is expected. The iPhone 5 does support landscape orientation, but it only has one image, so if you want it to be portrait or landscape you make the image appropriately sized and use that.

Thank you,

H.

I’m sorry but I don’t count this as acceptable expected behavior - perhaps you misunderstand what I’m saying.

Yes - iphones only support a portrait image. My image IS appropriately scaled and sized. If I restrict the application to portrait mode there is no problem.

The problem occurs when I allow my app to rotate freely. During the initial phase this image is fine. If I continue to hold my phone upright this image is fine. If I rotate my phone though you get the above clipped problem.

Then the application core calls:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions

At this point UE4 is not finished loading, so it puts up it’s own splash screen - in the following code:

    [path setString: [path stringByAppendingPathComponent:ImageString]];
    UIImage* image = [[UIImage alloc] initWithContentsOfFile: path];
    [path release];
    UIImage* imageToDisplay = [UIImage imageWithCGImage: [image CGImage] scale: 1.0 orientation: orient];
    UIImageView* imageView = [[UIImageView alloc] initWithImage: imageToDisplay];
    imageView.frame = MainFrame;
    imageView.tag = 2;
    [self.Window addSubview: imageView];
    GShowSplashScreen = true;

THIS is the image that causes problems. I don’t have control over it without modifying the engine code (for instance as I put above, though that code is not generic enough to work in the engine itself).

Here’s a project demonstrating the bug.
link text

And actually my ipad has the same problem.

Definitely should be considered a bug, though if you are about to drop the older devices and this doesn’t affect any devices supported from 4.17 I could understand waiving it.

If it does affect devices going forwards it should be considered a bug (it’s very ugly, fixable and in engine code).

For iPad the problem is a bit different. It only kicks in if I have the device rotated when the UE4 splash screen takes over. Will debug, suspect it’s picking the right screen based on device orientation but not locking the device to that orientation (so my “fix” above doesn’t work, but nor does the UE4 splash screen).

If that’s right the correct minimal fix approach for ipad would be to lock the orientation to whatever was selected when the UE4 splash is created.

My suggested solution works (for anyone encountering this, who can modify the engine and can ignore the project settings for their own code):

GAllowedSplashOrientations = self.bDeviceInPortraitMode ? UIInterfaceOrientationMaskPortrait : UIInterfaceOrientationMaskLandscape;

Cached right as we create the UIView.

Then:

-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow : (UIWindow *)window
{
    //IPhone 4/5 models do not have landscape launch images so
    //we fix them in portrait mode while showing the splash screen.
	//iPad is showing the same problem
	if (FPlatformMisc::GetIOSDeviceType() <= FPlatformMisc::IOS_IPhone5S)
    {
        if (GShowSplashScreen)
        {
            return UIInterfaceOrientationMaskPortrait;
        }
    }
    
    return GShowSplashScreen ? GAllowedSplashOrientations : GAllowedOrientations;
}

Basically we lock the orientation to whatever the UIView was setup for.