NSGenericException’, reason: ‘Unable to install constraint on view

You need to install the constraint on the “higher” of the two views. A good, general way to do this is like this: NSLayoutConstraint* constraint = …; NSView* firstView = constraint.firstItem; NSView* secondView = constraint.secondItem; [[firstView ancestorSharedWithView: secondView] addConstraint: constraint]; Just a word of caution: It’s good to remember here that constraint attributes are evaluated … Read more

change the height of a UICollectionReuseableView (collection section header) dynamically

Your delegate should implement the following function, assuming you’re using a flow layout: – (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section; You can return a different size for each header. In horizontally scrolling collection views, only the width is used. In vertically scrolling ones, only the height is used. The unused value is ignored — your view will … Read more

Dynamic UIView height with auto layout in iOS 6

You are setting the height contraint of your webView as 266. That’s why the height of the web view is still fixed. You can create this height constraint as an IBOutlet, for example: @property (weak, nonatomic) IBOutlet NSLayoutConstraint *webViewHeightConstraint; And then you can modify the constant of the height constraint when the web view has … Read more