ios - iOS 7上的动画问题,但iOS 8上没有
<p>我有一个动画,在ios 8中运行良好,但在ios 7中没有。事实上,似乎有时块的一部分是动画的,而另一部分不是(或者可能是不同的动画持续时间)。这很难解释。<br><pre><code>__block BTQMenuItemView *previousToClose = nil;
[UIView animateWithDuration:(animated ? kAnimationDuration : 0.f) animations:^{
[_menuItemViews enumerateObjectsUsingBlock:^(BTQMenuItemView *current, NSUInteger idx, BOOL *stop) {
BTQMenuItemView *previous = (idx > 0 ? _menuItemViews : nil);
if(previous.expanded && sender == previous) {
current.top = current.savedFrame.origin.y + sender.item.contentView.height + (sender.item.titleView ? sender.item.titleView.height - sender.height : 0) + sender.item.marginTopContent;
sender.height += sender.item.contentView.height;
sender.height += sender.item.titleView.height;
sender.item.contentView.top = (sender.item.titleView ? sender.item.titleView.bottom : sender.titleLabel.bottom) + sender.item.marginTopContent;
sender.actionView.height += (sender.item.titleView ? sender.item.titleView.height -sender.actionView.height : 0);
} else {
if(previous.expanded) {
previous.height = previous.savedFrame.size.height;
previous.actionView.height= previous.titleLabel.height;
previous.expanded = NO;
previousToClose = previous;
}
current.height = current.savedFrame.size.height;
current.top = previous.bottom;
}
}];
BTQMenuItemView *lastView = ;
_bottomCacheView.height =self.superview.height - self.top - lastView.bottom - _edgeInsets.bottom;
_bottomCacheView.top =lastView.bottom;
} completion:^(BOOL finished) {
BTQMenuItemView *lastView = ;
self.height = lastView.bottom;
}];
;
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p>原来iOS8中的动画系统有些变化。这里解释得很好(第一个答案解决了我的问题)=><a href="https://stackoverflow.com/questions/24472663/ios-8-animation-bug" rel="noreferrer noopener nofollow">iOS 8 animation bug</a><br>你也可以阅读这篇文章。</p>
<p style="font-size: 20px;">关于ios - iOS 7上的动画问题,但iOS 8上没有,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/30728597/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/30728597/
</a>
</p>
页:
[1]