Below code explains how you can place a view to the centre of the layout using Autolayout in iOS.
[self.view addConstraint: [NSLayoutConstraint constraintWithItem:self.view attribute:NSLayoutAttributeCenterX relatedBy: 0 toItem:view attribute:NSLayoutAttributeCenterX multiplier: 1 constant: 0 ]]; [self.view addConstraint: [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeCenterY relatedBy: 0 toItem:view attribute:NSLayoutAttributeCenterY multiplier: 1 constant: 0 ]]; |