问题
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?
回答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.
回答2:
You can disable autolayout if you don't need it, that helps. Otherwise, wait for next patch~
来源:https://stackoverflow.com/questions/26669173/xcode-6-1-uiviews-disappearing-in-interface-builder-when-adjusting-frames