views:

42

answers:

1

So I'm trying to animate an image stretching from a zero width to full size while fading in. The fade in comes across fine, but for whatever reason the thing appears at the full frame at the start of the animation, instead of growing as the alpha effect happens. My code is as follows:

[UIView beginAnimations:@"FadeButtons" context:nil];
[UIView setAnimationDuration:.9];
[UIView setAnimationDelay:0.300];
batteryLife.alpha = 1;
batteryLife.frame = CGRectMake(40, 71, 240, 128);
[UIView commitAnimations];

Any advice on changing a frame in an animated fashion? I don't want to scale the entire image, I want to "unveil" it. Thanks.

A: 

Perhaps the frame is already that size before beginAnimations? Try setting the frame immediately before beginAnimations to the smaller size, like batteryLife.frame = CGRectMake(40, 71, 0, 128);

Peter DeWeese