Xcode 6.1: UIViews disappearing in interface build

2019-05-09 23:38发布

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.

Here is a short 7 second video of the problem: https://vine.co/v/OMlbMIdWMe5

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.

I am using Xcode 6.1 . What could be causing this?

***EDIT: If I add 1 constraint to a view, it won't disappear when I readjust the frame of the other view. That is:

Add a constraint to ViewOne then readjusting size of ViewTwo will only cause ViewThree (without any constraints) to disappear.

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?

2条回答
对你真心纯属浪费
2楼-- · 2019-05-10 00:31

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.

查看更多
干净又极端
3楼-- · 2019-05-10 00:34

You can disable autolayout if you don't need it, that helps. Otherwise, wait for next patch~

查看更多
登录 后发表回答