views:

81

answers:

1

Here is my code,

egg[0] = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Big_egg.png"]];
egg[0].transform = CGAffineTransformMakeScale(0.0, 0.0);
egg[0].alpha = 1;
[self addSubview:egg[0]];

I want to rotate the egg and simultaneously the size of egg is increasing, my code for this is,

[ UIView beginAnimations:nil context:nil];
[ UIView setAnimationCurve: UIViewAnimationCurveLinear ] ;
[ UIView setAnimationDuration:3.0 ]; 
egg[0].transform = CGAffineTransformMakeScale(1.0, 1.0);
egg[0].transform = CGAffineTransformRotate(egg[0].transform,2*M_PI/180.0);
[ UIView commitAnimations] ;

Due to this i got blink on my screen, at the time of execution, I want to remove it. Is there any way to do this?

A: 

It looks like you have a few issues which might be giving you problems

First, you aren't changing the scale 1.0, 1.0 is a scale factor of 1 in both the x and y directions. pick a number larger or smaller than 1, I chose 0.5.

Second, you are setting the transform twice. only set it once, create temp variable to hold it while you are manipulating it (a common Cocoa pattern):

   CGAffineTransform tempTransform = CGAffineTransformScale(egg[0].transform, 0.5, 0.5);
   tempTransform = CGAffineTransformRotate(tempTransform, 2*M_PI/180.0);
   egg[0].transform = tempTransform;
Corey Floyd