0

I set up a Launch Screen in xcode with Inferred Size, Simulated Size: Fixed. I put a View in it that covers the whole View Controller. In that View is an image and a label. Both the image and label have height and width constraints, in addition to constraints centering both items with the superview center, yet somehow whenever I run the simulation the label is centered on the screen but the image is off to the right. Anyone know what I need to fix here? Thanks!

screenshot

Edit: It turns out I had a previous launch screen file listed in Info.plist. I updated it with the new launch screen file name and it worked. I also changed the launch screen to remove the splash.

Bob F.
  • 93
  • 1
  • 11

2 Answers2

1

Use width and height equal to, and align your view horizontally in the container..

Also, as per Apple's human guidelines they advise against having a splash screen.

Do2
  • 1,751
  • 1
  • 16
  • 28
  • Haha well then I guess it's moot. Thanks! – Bob F. Oct 17 '16 at 00:54
  • Its unnecessary to have a splash screen. Just have your launchscreen blank with background color the same as your first view controller's. – Do2 Oct 17 '16 at 01:17
  • I guess I'll have to come up with a background color then lol. Thanks! – Bob F. Oct 20 '16 at 10:39
  • I could've sworn apple was requiring splash screen not more than 2-3 years ago; did they reverse this advice? – pete Aug 06 '20 at 03:37
-1

Workaround of this issue is to not place image vertically centered. You can move image a bit to top or bottom. In such way issue won't be visible.

  • This may work, but it's only a workaround for something that is actually possible without having to compromise on the design in this way. – Abizern Aug 27 '18 at 11:29