In xcode 6.1, interface builder deleting ui elements

后端 未结 9 1980
走了就别回头了
走了就别回头了 2021-01-11 16:30

I have a view with some tableviews and some collection views and also some buttons and labels.

I\'m not sure if this is new with Xcode 6.1 because I have not worked

相关标签:
9条回答
  • 2021-01-11 17:04

    I have got the same kind of problem with Xcode 6.1 and Yosemite : I have created a view that I have added to the main view, so it appears like a sub view in the View Controller Scene. Then I resize this subview to 320 x 568. My program works. It corresponds to the program dropit of Stanford CS193P Lecture 9. I save the project, close it and reopen it : the subview has its width and height set to 0 !

    I tried to open the project dropit of Lecture 8 that is quite the same, which was working before (I think in Xcode 6) and same problem ! First I thought that tapping (related to the subview) was not working but found out that tapping was not working because I was tapping on a subview which has its width and height set to 0 !

    0 讨论(0)
  • 2021-01-11 17:07

    I acheived a fix, at least for this project by turning off auto layout in "show the file inspector" -> "interface builder document"

    I have never used this feature in the past so I do not know if it was on in the past but I am wondering if the new Xcode version turns it on by default where the others left it off. It may also be possible that it has always been on but there is a bug in the feature in the new version.

    This fixed the issue for me, at least in this particular project and at least for now. I hope others find this useful.

    0 讨论(0)
  • 2021-01-11 17:11

    same problem, yosemit and xocde 6.1. I can resize some view only if i disable autolayout.

    0 讨论(0)
  • 2021-01-11 17:21

    I think I ran into this 'problem'. I believe this was because one of the constraints I had was not setup correctly.

    0 讨论(0)
  • 2021-01-11 17:22

    I have reset the size class wCompact hAny to which all the UIElements are added. and got corrected.

    0 讨论(0)
  • 2021-01-11 17:24

    From here it looks like a bug in Xcode 6.1.

    I created a clean project and the behaviour is the same on my machine:

    https://github.com/nasht/Xcode6ConstraintTest.git

    Resizing one view makes others disappear. Changing a layout constraint from a = to <= or >= also seems to do it.

    I've raised a bug with Apple. Suggest you do the same.

    workaround: You can install xcode 6.01 and use interface builder from there. You can still compile and run your code using xcode 6.1 if you're relying on xcode 6.1 specific features. (you'll need to rename your xcode.app so you can run both instances. ) It's ugly, but it works.

    0 讨论(0)
提交回复
热议问题