4

I've encountered this problem on Xcode 6 Beta 6. When I select the main storyboard view where I can see all the views of my app with all the components (buttons, lists etc.) I can only see the view itself but no components in them event though I have put them there before. When I build and run the app in the simulator all the components are visible, but when I develop I cannot see them. On the left side of the user interface view of main storyboard all the controllers are listed, and when I expand each of them I can see the components that should be displayed on the view but they are like disabled (faded out).

The compiler does not show any errors or warnings. Does anyone have a clue of what's going on and how I can fix this?

EDIT: I have now installed the latest version but I still have the same problem. Has no-one ever had this problem?

user2099024
  • 1,242
  • 3
  • 15
  • 25

2 Answers2

22

I had the same problem. The problem is that the invisible/greyed out views are not "installed" for the currently selected size class. You can see what size class(es) a view is installed for by selecting that view and then going to the Attributes Inspector in the right pane and scrolling all the way to the bottom. There should be one or more checkboxes that say Installed.

This will tell you which size classes a view is installed in. Clicking on the checkboxes will install/uninstall that view for the given size class. To get the views to appear on the storyboard, you need to select the size class that they are installed in by clicking on the control in the center of the bottom bar in the storyboard (it will show you the currently selected w and h size classes).

I'm not sure what I did to cause my views to be uninstalled for the currently-selected size classes, but making sure that all the checkboxes here were checked brought my views back.

If you find Size Classes to be too much trouble, you can go to the File Inspector pane and disable size classes entirely by unchecking the Use Size Classes checkbox.

Peter
  • 221
  • 1
  • 4
  • 2
    this should be the accepted answer! holy cow, i just finished some iphone layouts and suddenly my views disappeared in the ipad layout! already though i have to do all of them again! thanks mate, this helps! – dy_ Mar 07 '15 at 16:18
7

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.

user2099024
  • 1,242
  • 3
  • 15
  • 25
  • My view was like disabled, but this gave me a hint to add width and height to the view constraints in auto layout and it worked! thanks – fullmoon Jul 06 '15 at 06:43