I want my UIButton
to make a UIAnimation
where it gets resized and repositioned when clicked. But it seems this can't be done when the UIButton
is using auto layout
.
This is the code I want to perform:
- (IBAction)buttonClicked:(id)sender {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationDuration:.15];
[button setFrame:CGRectMake(100, 50, 20, 20)];
[UIView commitAnimations];
}
But as long as this button
uses auto layout
and contraints
the animation won't be performed. What is the solution here? Work around?