iOS---约束变化动画处理 .constant

2018-12-06  本文已影响0人  BabyNeedCare

在需要用到对约束.constant的动画,添加类似以下的代码:

下面是解决方法的代码 

//约束动画

[self.view layoutIfNeeded];

[UIView animateWithDuration:0.3

animations:^{

self.textlayout.constant = 0;/*例如xxx.constant*/

[self.view layoutIfNeeded]; // Called on parent view

}];

上一篇 下一篇

猜你喜欢

热点阅读