3

I am trying to set up a launching screen for my app, but when I add any UI element to the view controller in the launch screen storyboard, I don't see any option for setting constraints like in the main storyboard.

What can be the possible cause?

shim
  • 9,289
  • 12
  • 69
  • 108
Mohamed Ali
  • 263
  • 3
  • 13
  • You should be able to add constraints to a view without any issue. Usually with Launchscreen.storyboard you can't add any custom code, but auto layout should work fine. If it's not - I would assume there's an issue. It should be just like the main storyboard, with the constraints button down at the bottom right. – Pierce Jan 30 '17 at 19:16
  • Thank you Eric for your reply. That's what i always done, but this time i can't see the constraints button, not sure what is that!!, i would assume it's related to the localisation as i localised the app and Xcode created files for localisation but i am not sure! – Mohamed Ali Jan 30 '17 at 19:48
  • Oh gosh! I was only missing Use Auto layout!! – Mohamed Ali Jan 30 '17 at 20:55
  • Well - glad you sorted that out! :-) – Pierce Jan 30 '17 at 21:16

2 Answers2

3

Yes, you missed to check that checkmark box. For those who are facing same issue, following are the steps to enable Auto layout for Launch screen:

1) Select the launch screen view controller icon:

enter image description here

2) Go to the "File Inspector" on right panel:

enter image description here

3) Check the box saying "Use Auto layout" :

enter image description here

You'll be now able to set auto layout constraints to launch screen.

1

Open LaunchScreen.storyboard, and in the left pane CTRL+Drag the first components you want to participate to the second component, and use the opened pop-up window:

enter image description here

danielhadar
  • 2,031
  • 1
  • 16
  • 27