Remove Auto-Layout Constraints for Specific Object

Eric picture Eric · Nov 14, 2012 · Viewed 71.5k times · Source

I have a UIImageView embedded in a UIView. My entire app uses AutoLayout, but I want to remove constraints for the UIImageView. Xcode will not allow me to delete the constraints, is there a way to disable them for a specific object, set them to zero, something?

Answer

Thomas Decaux picture Thomas Decaux · Jun 21, 2013

I agree Xcode auto-layout is horrible to use if you want something particular...

What I use to remove constraints programatically:

[detailsPhotoView removeConstraints:detailsPhotoView.constraints];