我有UITableView
喜欢这个 -
我正在使用tblViewTopConstraint
-
UIScrollView's delegate
- (void) scrollViewDidScroll:(UIScrollView *)scrollView
动画代码 -
[self.tblViewTopConstraint setConstant:45.0f];
[UIView animateWithDuration:0.4f delay:0.f options:UIViewAnimationOptionCurveEaseOut animations:^{
[self.tblView.superview layoutIfNeeded];
} completion:^(BOOL finished) {
}];
动画工作正常,但如果我向上/向下滚动UITableView 5-6次,它会突然抛出这个崩溃 -
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to install constraint on view. Does the constraint reference something from outside the subtree of the view? That's illegal. constraint:<NSAutoresizingMaskLayoutConstraint:0xa75abb0 h=--& v=--& XYZCustomCell:0xb4c6f00.width == UITableViewWrapperView:0xb4bb710.width> view:<UITableViewWrapperView: 0xb4bb710; frame = (0 0; 320 459); autoresize = W+H; layer = <CALayer: 0xb4ca150>>'
答案 0 :(得分:0)
错误说,导致崩溃的约束是宽度约束:
constraint:<NSAutoresizingMaskLayoutConstraint:0xa75abb0 h=--& v=--& XYZCustomCell:0xb4c6f00.width == UITableViewWrapperView:0xb4bb710.width>
所以我不认为你的问题出在动画或特定约束上。