更新时间:2023-11-06 14:51:58
添加一个将视图高度设置为 0 的约束(NSLayoutAttributeHeight)对我有用:
Adding a constraint(NSLayoutAttributeHeight) that sets height of the view to 0 worked for me:
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.captchaView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0]];