NSLayoutConstraint activateConstraints:@[top, bottom, left, right]]; 如果你的App支持target最低版本号是iOS9,可以使用锚点布局NSLayoutAnchor
这里的约束动画,是通过 NSLayoutAnchor 做得。 一般我们用的是 SnapKit 设置约束,调用也差不多。
具体可以查看官方文档https://developer.apple.com/library/ios/documentation/AppKit/Reference/NSLayoutAnchor_ClassReference