Iphone X | Viewport not Fullscreen!


#1

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!


#2

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


#3

Adding:

{ name: "Default-1125-Portrait-2436h@3x.png", w: 1125, h: 2436 }, // iPhone X, portrait
{ name: "Default-1125-Landscape-2436h@3x.png", 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?)


#4

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: "Default@2x.png", w: 640, h: 960  }, // iPhone Retina, portrait
		{ name: "Default@2x.png", w: 640, h: 960 }, // iPhone Retina, portrait
		{ name: "Default-568h@2x.png", 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: "Default-Portrait@2x.png", w: 1536, h: 2048 }, // iPad Retina, portrait
		{ name: "Default-Landscape@2x.png", w: 2048, h: 1536 },	// iPad Retina, landscape
		{ name: "Default-667h@2x.png", w: 750, h: 1334 }, // iPhone 6, portrait
		{ name: "Default-736h@3x.png", w: 1242,	h: 2208 }, // iPhone 6 Plus, portrait
		{ name: "Default-Landscape.png", w: 1024, h: 768 }, // iPad, landscape
		{ name: "Default-Landscape@2x.png", w: 2048, h: 1536 },	// iPad Retina, landscape
		{ name: "Default-Landscape-568h@2x.png", w: 1136, h: 640 }, // iPhone 5, landscape
		{ name: "Default-Landscape-667h@2x.png", w: 1334, h: 750 }, // iPhone 6, landscape
		{ name: "Default-736h-Landscape@3x.png", w: 2208, h: 1242 }, // iPhone 6 Plus, landscape
		{ name: "Default-Portrait.png", w: 768, h: 1024 }, // iPad, portrait
		{ name: "Default-Portrait@2x.png", w: 1536, h: 2048 }, // iPad Retina, portrait
		{ name: "Default-1125-Portrait-2436h@3x.png", w: 1125, h: 2436 }, // iPhone X, portrait
		{ name: "Default-1125-Landscape-2436h@3x.png", 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" : "Default-1125-Portrait-2436h@3x.png",
       "subtype" : "2436h",
       "scale" : "3x"
     },
     {
       "orientation" : "landscape",
       "idiom" : "iphone",
       "extent" : "full-screen",
       "filename" : "Default-1125-Landscape-2436h@3x.png",
       "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!


Iphone x launch image
#5

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