I have a UIButton that, when clicked, will make the UIImageView scale a little larger, and then return to its normal size. It works, but I ran into a problem when the image gradually becomes a little smaller, the more you press the button.
How can I change the code so that the image does not shrink when I click the button? Here is the code that I have to scale the image a bit more, and then return to normal:
[UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration: 0.2]; myImage.transform = CGAffineTransformScale(myImage.transform, 1.03, 1.03); [UIView setAnimationDelegate:self]; [UIView commitAnimations]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration: 0.2]; myImage.transform = CGAffineTransformScale(myImage.transform, 0.97, 0.97); [UIView setAnimationDelegate:self]; [UIView commitAnimations];
Thanks for any help.
ios objective-c iphone
c0dec0de
source share