In xcode 6.1, interface builder deleting ui elemen

2019-02-16 12:41发布

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 on the ui aspect of this project for some time. However, when I try to resize just about anything in the view, my tableviews and collection views, and possibly some other elements I am not noticing, get deleted. Specifically, it seems their frame or rect propertied get deleted.

To be clear, this only occurs when I attempt to resize the element by dragging the sides in interface builder. If I resize them by changing the numbers directly either in the IB sidebar or in the xml, this does not happen.

I'm wondering if this is a bug in Xcode or if I have done something to cause this behavior which I can change.

Thanks!

9条回答
该账号已被封号
2楼-- · 2019-02-16 13:25

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.

查看更多
smile是对你的礼貌
3楼-- · 2019-02-16 13:26

What OS X Version are you on? I updated to Yosemite today and 6.1 along with it. When I would resize a label my other elements were not getting deleted but instead getting resized and repositioned. The width / height would change to 0,0 and the x / y would change to 0,0 as well.

I was noticing other issues with Yosemite so went ahead and did a time capsule restore back to Mavericks and Xcode 6.0

查看更多
放荡不羁爱自由
4楼-- · 2019-02-16 13:30

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

查看更多
登录 后发表回答