user-44651
user-44651

Reputation: 4124

Why is the storyboard blank and the views are greyed out?

I just opened my storyboard up and all my controls are gone and the views are greyed out (SECTION A). Though the app still compiles and shows the controls in the app.

I followed this other SO question but it didn't seem to work. Removing section B only causes a red box to appear.

  1. Did I do something wrong?
  2. How do I get them back?
  3. How do I prevent this in the future?

enter image description here

Upvotes: 0

Views: 195

Answers (1)

Mischa
Mischa

Reputation: 17231

It seems like you're using size classes without knowing about it.

If so, you should first try to understand what size classes are and how to use them. Here are some good starting points:

To resolve you current issue...

... and make all views appear again, first select the (Any | Any) size class in Interface Builder ('C' in your screenshot) and then do the following for each of your greyed-out views:

  1. Select the view.
  2. In the section to which your letter 'B' is pointing delete all rows that have some text in front of the checkbox (like "wAny hR") by clicking the ✕ in front of the row.
  3. Check the checkbox of the remaining line on top (in the same section).

This will install your views for all size classes. You'll see them both in Interface Builder and at runtime in Simulator or on your device.

Unless you've understood what size classes are all about and how to make use of them always make sure that the (Any | Any) size class is selected in Interface Builder before making any changes to your layout. (Because when you select a different size class and add views or constraints, those will only be added (= installed) to that particular size class and not to the others.)

Upvotes: 1

Related Questions