在需要用到对约束.constant的动画,添加类似以下的代码:
下面是解决方法的代码
//约束动画
[self.view layoutIfNeeded];
[UIView animateWithDuration:0.3
animations:^{
self.textlayout.constant = 0;/*例如xxx.constant*/
[self.view layoutIfNeeded]; // Called on parent view
}];
在需要用到对约束.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
网友评论