So I have this button with some text in it (title). And I would like to do a transform on it once it is loaded. The transform bounces the button just like the popup you get on the iPhone. The problem is once the transform/animation is done the whole button becomes blurry.
Here is before a transform:
And here is after:
The button is located at x 10, y 100, with w 300, h 190
And here is the code that does the transform
Code:
- (void)bounce1AnimationStopped {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:kTransitionDuration/2];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(bounce2AnimationStopped)];
randomButton.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9);
[UIView commitAnimations];
}
- (void)bounce2AnimationStopped {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:kTransitionDuration/2];
randomButton.transform = CGAffineTransformIdentity;
[UIView commitAnimations];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
randomButton.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001);
randomButton.hidden = NO;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:kTransitionDuration/1.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(bounce1AnimationStopped)];
randomButton.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1);
[UIView commitAnimations];
[super viewDidLoad];
}
As you can see, the button at the last animation is set to identity which should transform it back to the original.
Any help would be highly appreciated. Im pulling my hair here!!