one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand , refer to the documentation for the UIView property translatesAutoresizingMaskIntoCons traints) ( "<NSAutoresizingMaskLayoutConstraint:0x7fe709418da0 h=--& v=--& H:[UIImageView:0x7f e709434820(320)]>", "<NSLayoutConstraint:0x7fe70943b4b0 H:|-(0)-[UIImageView:0x7fe709434820] (Names: '|':UIView:0x7fe709434f40 )>", "<NSLayoutConstraint:0x7fe70943b500 H:[UIImageView:0x7fe709434820]-(0)-| (Names: '|':UIView:0x7fe709434f40 )>", "<NSLayoutConstraint:0x7fe709438470 'UIView-Encapsulated-Layout-Width' H:[UIView:0x 7fe709434f40(414)]>" )
your views for autolayout Autoresizing: predecessor to Auto Layout By default, all programmatically created views are configured for autoresizing compatibility Adds constraints that will mess yours up
Constraint Spacer is a UIView used to support up to 300px @"H:|[leftView(==rightView)]" @"H:|[leftView(<=100)][spacer(==leftView@999)][rightView(<=100)]|"
Modify constraints in updateConstraints method Change properties rather than replacing constraints Example: Resizing the height of a view Two constraints: heightConstraintCollapsed and heightConstraintExpanded