x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

iPhone 5 Landscape Splash is missing!

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

alt text

Product Version: UE 4.16
Tags:
image1[5030].png (24.8 kB)
more ▼

asked Jun 06 '17 at 08:53 PM in Bug Reports

avatar image

theonecalledtom
1.2k 60 63 266

avatar image theonecalledtom Jun 06 '17 at 10:17 PM

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

avatar image theonecalledtom Jun 07 '17 at 01:21 AM

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.

avatar image AndrewHurley Jun 07 '17 at 03:28 PM

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

avatar image theonecalledtom Jun 07 '17 at 04:38 PM

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.

avatar image AndrewHurley Jun 07 '17 at 06:51 PM

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,

Andrew H.

avatar image theonecalledtom Jun 07 '17 at 06:58 PM

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

avatar image theonecalledtom Jun 07 '17 at 08:17 PM

Here's a project demonstrating the bug. link text

avatar image theonecalledtom Jun 20 '17 at 05:24 PM

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

avatar image theonecalledtom Jun 21 '17 at 04:50 PM

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.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jun 21 '17 at 05:58 PM

avatar image

theonecalledtom
1.2k 60 63 266

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question