我有一个问题,扩展和承包一个UIEffectView。它扩张得很好,但当它收缩到最后的高度,滑行到适当的位置,留下微弱的振动效应。下面给出一个例子来说明这个问题。http://i.imgur.com/Lh8q7m1.gif

这发生在新的空白项目设置中,如下所示:

以下是动画代码:
- (IBAction)toggleEffects:(id)sender {
[self.view setNeedsLayout];
if(self._effectsHeight.constant == 50){
self._effectsHeight.constant = 500;
}else{
self._effectsHeight.constant = 50;
}
[UIView animateWithDuration:1.5f
animations:^{
[self.view layoutIfNeeded];
}];}
发布于 2015-01-11 20:50:30
我认为您必须以这样的方式设置动画block.Try中的调整大小代码:
[UIView animateWithDuration:1.5f
animations:^{
if(self._effectsHeight.constant == 50){
self._effectsHeight.constant = 500;
}else{
self._effectsHeight.constant = 50;
}
}];https://stackoverflow.com/questions/27158625
复制相似问题