I'm creating a UIButton with a stretchableImageWithLeftCapWidth:topCapHeight:
I would like to change it's size smoothly with Core Animation like so:
float shrinkFactor = 0.2;
NSTimeInterval slowSpeed = 5.0;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:slowSpeed];
UIButton *thisButton = (UIButton *)[self.view viewWithTag:2];
thisButton.frame = CGRectMake(thisButton.frame.origin.x, thisButton.frame.origin.y, buttonStretchedWidth * shrinkFactor, thisButton.frame.size.height);
[UIView commitAnimations];
The button image size doesn't animate, it just snaps to the new size.
When I make the backgroundColor of the button visible, I see the frame itself animates correctly.
Am I missing something or is the image stretching not animatable?