Facebook Pop:为UITableViewCell设置动画时出现问题

问题描述 投票:1回答:0

我正在通过以下方式对UITableViewCell进行动画处理,首先将其放大以显示更多详细信息:

[NSObject pop_animate:^{
    cell.pop_springBounciness = 16;
    cell.pop_springSpeed = 6;
    cell.pop_spring.frame = CGRectMake(x, y, width, expandedHeight);
} completion:^(BOOL finished) {
}];

这可以按预期工作,但是当我尝试再次缩小它时,出现异常:

[NSObject pop_animate:^{
    cell.pop_springBounciness = 16;
    cell.pop_springSpeed = 6;
    cell.pop_spring.frame = CGRectMake(x, y, width, shrinkedHeight);
} completion:^(BOOL finished) {
}];

这是我得到的例外:

Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x15b5de60 h=-&- v=-&- UITableViewCellScrollView:0x1536f120.height == TransactionCell:0x1536ef50.height - 0.264848>",
    "<NSAutoresizingMaskLayoutConstraint:0x15b5e4d0 h=--& v=--& V:[TransactionCell:0x1536ef50(0.163815)]>"
)

Will attempt to recover by breaking constraint 
<NSAutoresizingMaskLayoutConstraint:0x15b5de60 h=-&- v=-&- UITableViewCellScrollView:0x1536f120.height == TransactionCell:0x1536ef50.height - 0.264848>

Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

我想原因是由于春季动画,单元格的高度低于0-但是如何避免这种情况呢?

ios7 facebook-pop
© www.soinside.com 2019 - 2024. All rights reserved.