Why does Interface Builder show hidden views through the views above them?

北城余情 提交于 2020-01-05 06:54:07

问题


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



来源:https://stackoverflow.com/questions/22264235/why-does-interface-builder-show-hidden-views-through-the-views-above-them

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!