Iphone X | Viewport not Fullscreen!

Hello,

I’ve just tried my app in the Iphone X similator and unlike all the other Iphone iterations it shows black bars on the sides. Here a screenshot of an empty Haxe App.

A similar empty OBJC app looks as expected.

Is there anyway this can be fixed?

Thnx!

After some googling I’ve found out that its probably caused by incorrect launch image sizes: https://stackoverflow.com/a/46184998

Related to: Iphone x launch image

Adding:

{ name: "[email protected]", w: 1125, h: 2436 }, // iPhone X, portrait
{ name: "[email protected]", w: 2436, h: 1125 } // iPhone X, landscape

To var splashSizes:Array<SplashSize> will generate the Splash images, but other then that nothing changes.

Still hoping to fix this somehow!

@singmajesty the entries of the git commit (https://github.com/openfl/lime/commit/a1af7cecbf751c380fb9c6566bf497f74a0be16c) is not w:1125, h: 2436!! (typo?)

Found the problem.! The Contents.json of the “LaunchImage.launchimage” is not changed after changing the splashSizes:Array variable (some variables or templates needs to be adapted). A Quick workaround is to do the following:

In the haxelib folder (default: /usr/local/lib/haxe/lib/) edit the file ./lime/[version]/lime/tools/platforms/IOSPlatform.hx … Change the splashSizes array to:

	var splashSizes:Array<SplashSize> = [
		{ name: "Default.png", w: 320, h: 480 }, // iPhone, portrait
		{ name: "[email protected]", w: 640, h: 960  }, // iPhone Retina, portrait
		{ name: "[email protected]", w: 640, h: 960 }, // iPhone Retina, portrait
		{ name: "[email protected]", w: 640, h: 1136 }, // iPhone 5, portrait
		{ name: "Default-Portrait.png", w: 768, h: 1024 }, // iPad, portrait
		{ name: "Default-Landscape.png", w: 1024, h: 768  }, // iPad, landscape
		{ name: "[email protected]", w: 1536, h: 2048 }, // iPad Retina, portrait
		{ name: "[email protected]", w: 2048, h: 1536 },	// iPad Retina, landscape
		{ name: "[email protected]", w: 750, h: 1334 }, // iPhone 6, portrait
		{ name: "[email protected]", w: 1242,	h: 2208 }, // iPhone 6 Plus, portrait
		{ name: "Default-Landscape.png", w: 1024, h: 768 }, // iPad, landscape
		{ name: "[email protected]", w: 2048, h: 1536 },	// iPad Retina, landscape
		{ name: "[email protected]", w: 1136, h: 640 }, // iPhone 5, landscape
		{ name: "[email protected]", w: 1334, h: 750 }, // iPhone 6, landscape
		{ name: "[email protected]", w: 2208, h: 1242 }, // iPhone 6 Plus, landscape
		{ name: "Default-Portrait.png", w: 768, h: 1024 }, // iPad, portrait
		{ name: "[email protected]", w: 1536, h: 2048 }, // iPad Retina, portrait
		{ name: "[email protected]", w: 1125, h: 2436 }, // iPhone X, portrait
		{ name: "[email protected]", w: 2436, h: 1125 } // iPhone X, landscape
	];
  1. afterwards run haxelib run lime rebuild tools the enforce the changes. .

  2. Then delete the export directory from your project.

  3. rebuild your project.

  4. add the following values to the json array in: /Export/ios/[ProjectName]/Images.xcassets/LaunchImage.launchimage/Contents.json

    {
       "images" : [
       {
       "orientation" : "portrait",
       "idiom" : "iphone",
       "extent" : "full-screen",
       "minimum-system-version" : "11.0",
       "filename" : "[email protected]",
       "subtype" : "2436h",
       "scale" : "3x"
     },
     {
       "orientation" : "landscape",
       "idiom" : "iphone",
       "extent" : "full-screen",
       "filename" : "[email protected]",
       "minimum-system-version" : "11.0",
       "subtype" : "2436h",
       "scale" : "3x"
     },
    /* ..... */
    

Next time you build from xcode the problem is solved. Hopefully the source gets updated to this in the near future!

1 Like

Thanks! I think the JSON was what we were missing. I’m committing that now, and will to try to test more