[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.subview1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0]]; [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.lblTermsOfUse attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.subview2 attribute:NSLayoutAttributeTop multiplier:1 constant:20]];