Xcode 6.1:调整帧时,UIViews在界面构建器中消失 [英] Xcode 6.1: UIViews disappearing in interface builder when adjusting frames
问题描述
我是Interface Builder的新手,我正在尝试使用非常简单的视图
来练习它。基本上,我的视图控制器
上有3 UIViews
。我遇到的问题是每当我调整UIViews中的1帧时,其他2将消失。
I'm fairly new to Interface Builder and I'm trying to practice it with a very simple view
. Basically, I have 3 UIViews
on my view controller
. The problem I am having is that whenever I adjust the frame of 1 of the UIViews, the other 2 will disappear.
这是一个短暂的7秒问题视频: https://vine.co/v/OMlbMIdWMe5
Here is a short 7 second video of the problem: https://vine.co/v/OMlbMIdWMe5
如果我在我的设备上运行该应用程序,我只会看到其中一个视图(我调整的是1) - 其他2个仍然是隐藏的。
If I run the app on my device, I only see 1 of the views (the 1 I was adjusting) - the other 2 remain hidden.
我是使用 Xcode 6.1
。造成这种情况的原因是什么?
I am using Xcode 6.1
. What could be causing this?
***编辑:如果我向视图添加1个约束,当我重新调整另一个视图的帧时它不会消失。即:
*** If I add 1 constraint to a view, it won't disappear when I readjust the frame of the other view. That is:
向 ViewOne
添加约束,然后重新调整 ViewTwo $的大小c $ c>只会导致
ViewThree
(没有任何约束)消失。
Add a constraint to ViewOne
then readjusting size of ViewTwo
will only cause ViewThree
(without any constraints) to disappear.
因此解决方案是添加在重新调整其中任何一个框架之前对所有3个视图的约束。但是,仍然可能导致这个问题的原因是什么?
So the solution is to add constraints to all 3 views before readjusting the frame of any of them. But still, what could be causing this issue?
推荐答案
这是Xcode 6.1的一个问题,并且已经报告给了苹果。可以找到类似的帖子这里。
This is an issue with Xcode 6.1, and has been reported to apple. A similar post can be found here.
解决方法:我发现您可以在尺寸检查器中编辑情节提要编辑器右侧窗格中的约束。它实际上并不能证明这很乏味。
WORKAROUND: I have found that you can edit the constraints in the right hand pane of the storyboard editor, in the size inspector. It actually does not prove that tedious.
这篇关于Xcode 6.1:调整帧时,UIViews在界面构建器中消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!