Check whether you added the programmatically created view to its parent before activating constraints
Check whether you write constraints activation code inside viewDidLoad() / viewWillAppear(). You should write constraints activation code in updateViewConstraints or viewWillLayoutSubviews. ( suggested by vmeyer )
Check whether you turn off translatesAutoresizingMaskIntoConstraints.