简体   繁体   English

如何在故事板中查看自定义UIView的轮廓?

[英]How to view outline of a custom UIView in a Storyboard?

I made a custom UIView for a project. 我为一个项目制作了一个自定义的UIView。 I know how to insert it in a StoryBoard (as a generic view, then by specifying its class), and it compiles and runs fine. 我知道如何将它插入StoryBoard(作为通用视图,然后通过指定其类),它编译并运行正常。 However, the custom view is rendered in the storyboard as a white rectangle without a visible border. 但是,自定义视图在故事板中呈现为没有可见边框的白色矩形。 It means that when the view is unselected, it becomes invisible on the storyboard if the window background is white. 这意味着当视图未被选中时,如果窗口背景为白色,则它在故事板上变得不可见。 It is then very difficult to adjust its position/size, and it's going to be really painful when I will add more views. 然后很难调整它的位置/大小,当我添加更多视图时会非常痛苦。

I perfectly understand that the storyboard does not provide any kind of rendering and I'm not asking for this, but is there any solution to display the boundaries of the view as a simple border so I can still view it without having to select it ? 我完全理解故事板不提供任何类型的渲染,我不是要求这个,但有没有任何解决方案将视图的边界显示为一个简单的边框,所以我仍然可以查看它而不必选择它?

菜单Editor->CanvasShow bounds rectanglesShow layout rectangles中有两个选项,这正是我想要的!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM