如何设置约束到移动按钮
答
您应该添加IBOutlet NSLayoutConstraint
,然后您可以使用按钮移动。任何这样的。
self.someView.constant = 30;
[self.view setNeedsUpdateConstraints];
[UIView animateWithDuration:0.25f animations:^{
[self.view layoutIfNeeded];
}];
如果一个按钮在动画中移动,那么您想要对其施加什么样的约束? –
该按钮应该在x位置上移动,我想把约束,因为它应该出现在所有IOS设备正确.. – aman