天天看点

调用UIView的animateWithDuration 控制layout constraint 动画无效问题

调用UIView的animateWithDuration设计简单的动画是很方便的。

但使用ui constraint 进行界面设计时,animateWithDuration的动画不起作用。问题可能出现在:

   1.没有调用[xx layoutIfNeeded]。  xx 你需要调整 constraint的view

   2.调用layoutIfNeeded的对象不正确。

继续阅读