美文网首页
iOS---约束变化动画处理 .constant

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

作者: BabyNeedCare | 来源:发表于2018-12-06 16:49 被阅读0次

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

下面是解决方法的代码 

//约束动画

[self.view layoutIfNeeded];

[UIView animateWithDuration:0.3

animations:^{

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

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

}];

相关文章

网友评论

      本文标题:iOS---约束变化动画处理 .constant

      本文链接:https://www.haomeiwen.com/subject/buiocqtx.html