我正在尝试定位标签,使标签顶部位于 UIViewController 下方的 2/3 处。所以我写了这个约束,但它给了我下面的错误。
NSLayoutConstraint *labelTopConstraint = [NSLayoutConstraint constraintWithItem:self.myLabel
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationGreaterThanOrEqual
toItem:self.view
attribute:NSLayoutAttributeHeight
multiplier:0.66
constant:0];
错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** +[NSLayoutConstraint
constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]:
Invalid pairing of layout attributes'