Xcode Storyboard "Embed In" Scroll View blanks view controller OSX

1.9k views Asked by At

I have created a View Controller with some content defined in it. When I embed that content in a ScrollView (using the "Embed In" from the "Editor" menu) then the content disappears when I run the application. Curiously if I only embed just one label in a scrollview then that single label still appears.

enter image description here enter image description here

What is going on here. Am I missing something obvious?

1

There are 1 answers

0
iphaaw On BEST ANSWER

It turns out that when you first use the Embed In command it will correctly embed the objects into the form, but if there are no constraints then the objects are probably drawn offscreen. Setting constraints for the embedded objects caused them to be drawn correctly.

enter image description here

Simply select 'Reset to Suggest Contraints for all views in View Controller and it will start to work.

enter image description here

Hope this helps someone.