0

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?

Peter
  • 1,848
  • 4
  • 26
  • 44

0 Answers0