Sajjon
Sajjon

Reputation: 9897

Xcode 8 attribute "hidden" does not hide view in Interface Builder

seems like Apple change how Interface Builder behaves in Xcode 8? Because when I check hidden in Attributes Inspector on a view in Interface Builder, that view is still visible.

This makes it very tedious to work with views where some views needs to be the view with the highest "z value", the front most view that is.

Is there some other way to show the green view in this example, than to change the order of them to the right (i.e. change their "z value")

In the image below hidden is checked, but I still don't see the green view below. You can download this trivial project at github

When the project is run, the green view is indeed shown, but the issues is that it is annoying when working in Interface Builder.

enter image description here

Am I missing something?

Upvotes: 5

Views: 2921

Answers (3)

Paul Schröder
Paul Schröder

Reputation: 1540

How about unchecking the installed checkbox of the red view? This has also the flaw that you have to remember to reinstall it, but you don't have to change the z-order of your views.

Upvotes: 3

msweet168
msweet168

Reputation: 371

I have the same opinion on it and I also believe that it's annoying. I with they gave you the choice to update the actual storyboard before runtime or not but they didn't so for now we have to deal with it.

There is a quick alternative option though. Hidden will not update in the storyboard but alpha will. If you change the alpha it will update in the storyboard so if you want to see the view behind it just change alpha to 0. You can always change it back easily or if your doing it in code, instead of unhiding your view just change the code so the alpha is set to 1.

Upvotes: 5

matt
matt

Reputation: 535159

This is deliberate. We wouldn't want a view to be hidden from you, the editor, just because it will be hidden when the app runs. You can easily select a covered view, such as the green view, using Shift-Control-Click on the red view (or use the document outline at the left of your screen shot).

Upvotes: 1

Related Questions