Why Don't My Views Show Up in Storyboards and Are Greyed Out in the Left Pane

Why don't my views show up in Storyboards and are greyed out in the left pane?

Just found an answer myself, it was because Size Classes were reset after I moved the project...

Greying out views is Xcode's standard behaviour when the views are only set for a specific size class which is currently not selected!

I had set the size classes for my UIViewController to Compact - Any, this is what it looks like in proper state:

Sample Image

The problem occurs when I change the size classes to another one (e.g. Any - Any):

Sample Image

UI elements not visible on Storyboard editor, but visible on some device sizes

It's because the views have been set for a different size class in Interface Builder than the one which you have currently selected.

Just modify your current size class to the one for which the views have been defined.

I encountered the same issue, read more here: Why don't my views show up in Storyboards and are greyed out in the left pane? and Interface Builder Objects not visible in my storyboard (and titles are transparent)

Note that whenever you have a particular size class selected, all UI elements will only be available/visible within that particular size class.

Interface Builder Objects not visible in my storyboard (and titles are transparent)

It's because the views have been set for a different size class in Interface Builder, and not Any & Any, which you have currently selected.

Just change the size class in the interface builder appropriately and the views will be back! :)

I encountered the same issue, read more here: Why don't my views show up in Storyboards and are greyed out in the left pane?

How do I bring from the dead elements from a viewController

This is just a guess, but what I would try is: Turn off size classes first in the original storyboard, and then copy.

(If you don't want to risk losing information from the original when you turn off size classes, make a duplicate of the original storyboard first.)

Xcode Storyboard: Can't add View to ViewController

NavigationController that automatically created UIViewController 2

That explains everything. When you drag a navigation controller into the storyboard, what you get is a navigation controller and its root view controller, and the root view controller is a UITableViewController.

Let's step back for a moment. A view controller can and must have exactly one main view. It occupies the whole scene. It cannot be resized. It cannot have a sibling view, because it has no superview for a sibling view to be a child of. It can only have children (subviews).

Well, in this case, ViewController2 is a UITableViewController, and MyTableView is ViewController2’s main view. (A table view controller is always configured this way, and that is what you got when you dragged the navigation controller into the storyboard.) That is why you cannot add more views to it, except as subviews, e.g. prototype cell contents. Your button has no place to go except inside the table view.

So, what to do?

  • If the extra interface you want to add is just a button, the usual solution is to put it into the navigation bar. It becomes part of the table view controller's navigation item.

  • If you don't want to do that — that is, if you really want the button and the table view to be siblings of one another in the interface — then you need to replace ViewController2 itself with an ordinary view controller. Now its main view will be an ordinary view, and you can drag anything you like into it, including a table view and a button. More likely, instead of a bare table view, you would use a container view, with an embed segue to a table view controller.

Constraint controls greyed out in Xcode (pinning toolbar to bottom)

So it looks like you want a table view and a toolbar in the same window. The way to set that up in Xcode is to use a navigation interface, because it has a toolbar. You aren't going to be doing any navigating, perhaps, but that's not important. Start with a navigation interface, and have the table view controller as its child (its root view controller). Now configure the navigation view controller so that the navigation bar is not showing but the toolbar is.

(Of course, if you are already in a navigation interface, then just show its toolbar and you're there.)

No constraints are involved.

Xcode 6 beta 6 - Items on main story board have disappeared/disabled

Ok now it's fixed. For everyone who has encoutered the same problem here is what I did. First of all I installed the newest version of xcode but the problem was still there. Then I opened the main storyboard and I saw that some of my views had the wrong size (not the iphone size as I had chosen when I made the views - it was the size of an ipad or something like that). So what I did was just to select the views that had the wrong size and resize them to iphone-size again by clicking on the "Any Any" button on the bottom of xcode after selecting a view.



Related Topics



Leave a reply



Submit