I wish to re-size button at the place where it`s located and delay it, can you please help me?
(sender=UIButton)
My function:
-(IBAction)Animate: (id) sender
{
[sender setBackgroundImage:[UIImage imageNamed:@"Text Bg large.png"] forState:UIControlStateNormal];
CABasicAnimation *scale;
scale = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
scale.fromValue = [NSNumber numberWithFloat:1];
scale.toValue = [NSNumber numberWithFloat:1.3];
scale.duration = 1;
scale.removedOnCompletion = NO;
scale.repeatCount = 1;
[sender addAnimation:scale forKey:@""];
[sender setFrame:(CGRectMake(x, y, z, w))];
}
What do i use for x,y,z,w if i wish that button will stay at the same location, and grow 1.3 time larger without entering values manually. Oh, and how i can delay the this operation?
Is there any reason you’re using
CAAnimationto do this?How about:
or