Why does Interface Builder show hidden views throu

2019-08-05 00:30发布

问题:

When nesting views in Interface Builder, if I have an opaque view with hidden views beneath it in the view Hierarchy, the hidden views are visible through the higher view and are just partially translucent like the below picture.

Why does this happen and can I make it stop? It's very annoying.

To be clear this is strictly in IB. At run time the views are displayed correctly.

回答1:

Sad to see this is the best answer that I have found so far: If you set the view you want to work as NOT hidden, while all the rest ARE hidden, then you can select away from the storyboard (e.g. some other file), then click back on the storyboard. Only the NON-hidden views are displayed. Sadly, the other views comeback if you make position alterations to the view (UPDATE: only when you click and drag. Selecting and using arrow keys does not), but changing text, size, color etc do not.

Original with hidden

Clicked off storyboard and back