constraints on launch screen storyboard

I copied and pasted a scroll view containing contents from my main storyboard to my launchscreen storyboard. It was successful, but I'm not able to set-spacing-to-nearest-neighbor constraints. When I click on the Add-new-constraints icon, everything is blank and disabled.

Accepted Reply

Yes, the root view of a scene cannot be given constraints. You should have put the scroll view inside the root view, instead of using it as a replacement for the root view; then you would have been able to add constraints to the scroll view. In any case, I doubt that a scroll view in the launch screen adheres to the iOS Human Interface Guidlines.

Replies

When pasting, you may import attributes you dont want.


control-click on the pasted scrollView to see what is on, eventually disable it.

Clear constraints


You can also do an option clean to be sure.

There are no constraints on the scroll view. They didn't get copied and pasted. But there are constraints on the controls within the scroll view. I need those there.


When you say option clean, do you mean on the Xcode menu go to Product->Clean?

How do I clear the constraints other than finding them in the Document Outline and deleting them?

I just tried adding a scroll view on the view controller in the launchscreen storyboard to see if I could add constraints to it. It wouldn't let me add constraints using the Add New Constraints icon at the bottom right of the scene. It wouldn't work with a plain view either. If this is the case, how does the launchscreen adapt to different sizes of displays in different devices for iOS by using a single launch image and auto layout?

I figured it out. The view that the view controller takes control of automatically covers the entire screen. That's why I am not allowed to add constraints to it.

Yes, the root view of a scene cannot be given constraints. You should have put the scroll view inside the root view, instead of using it as a replacement for the root view; then you would have been able to add constraints to the scroll view. In any case, I doubt that a scroll view in the launch screen adheres to the iOS Human Interface Guidlines.