我被一种奇怪的行为困住了
我以编程方式在“UISlider”和“UILabel”之间添加了一个尾随约束,它看起来像这样:
NSLayoutConstraint *timeLabelTrailing = [NSLayoutConstraint
constraintWithItem:_timeLbl
attribute:NSLayoutAttributeTrailing
relatedBy:NSLayoutRelationEqual
toItem:_seekBar
attribute:NSLayoutAttributeTrailing
multiplier:1
constant:0];
[timeLabelTrailing setActive:true];
[self layoutIfNeeded];
并且“UILabel”尾随与“UISlider”尾随不匹配。
我试图在“UILabel”和“UIViewControoler”视图之间做同样的事情,它工作得很好,但是使用“UISlider”就出错了。
附上一些来自 ViewDebugger 的照片:
滑块
标签



