Masonry + UIView Animations 注意事项

1:动画

在动画[UIView beginAnimations:nil context:nil]以前必定要先执行: [self.itemView layoutIfNeeded];spa

这样能够一开始肯定好itemView在动画以前开始的位置,否则的话他会在左上角的座标:(0,0)开始it

 

2:io

[UIView commitAnimations];以前也要执行[self.itemView layoutIfNeeded];class

否则动画可能没有效果或者不是你想要的im

 

3:layout

有beginAnimations就必定要有写commitAnimationsco

虽然不写代码也是有效,但你会发现后面更改UI位置的时候全都有动画了,这个问题当明害我找得很久,都不知道什么问题context

相关文章
相关标签/搜索