Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A popup, "Failed to automatically update constraints" pops up in Xcode 6.3.1

When I added a couple of controls in my viewcontroller in storyboard and click Resolve Auto Layout Issues -> Reset to Suggested Constraints. The following popup appears and I cannot perform auto layout constraints.

enter image description here

Though, when I remove the Prototype Cell (which has a couple of labels and an imageview) from my tableview then auto layout works fine. Any thoughts?

Edited: And manually adding constraints to individual elements work fine as well. After manually setting the image view inside prototype cell, the auto layout has started working fine without popping up that popup. So, maybe, sometime, it is hard for auto layout to figure out all these constraints itself.

like image 991
zeeawan Avatar asked May 10 '15 11:05

zeeawan


2 Answers

Try clearing constraints before resetting them, this has worked for me before.enter image description here

like image 159
adrienMarsden.jpeg Avatar answered Oct 04 '22 14:10

adrienMarsden.jpeg


I had the same problem when using prototype cells in a UITableView and some other views in a UIViewController.

My solution was to select all the elements in the prototype cell and see if these had red or orange markers (constraint conflicts/problems). These elements I cleared the constraints for and afterwards I had no problem telling the entire view to "Reset to Suggested Constraints".

Obviously, Interface Builder has a problem resetting embedded table content constraints.

like image 35
mjrehder Avatar answered Oct 04 '22 13:10

mjrehder