Possible Duplicate:
Any quick and dirty anti-aliasing techniques for a rotated UIImageView?
I have an image view (myImage) in my app which has a border:
[myImage.layer setBorderColor: [[UIColor whiteColor] CGColor]];
[myImage.layer setBorderWidth: 1];
I am then using the following code to rotate it, in this case by 20 degrees.
NSInteger r = 20;
CABasicAnimation *imageRotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
imageRotation.toValue = [NSNumber numberWithFloat:((r*M_PI)/ -180)];
imageRotation.duration = 0.01;
imageRotation.repeatCount = 1;
imageRotation.removedOnCompletion = NO;
imageRotation.autoreverses=NO;
imageRotation.fillMode = kCAFillModeForwards;
[myImage.layer addAnimation:imageRotation forKey:@"imageRotation"];
The code above rotates the image, but you cannot see it animated (because of the very low imageRotation.duration). After the rotation is complete the result is an image view, that is not moving or rotating, but has been rotated by 20.
This code is working fine, however the lines of both the border and containing image are not smooth which is ruining the display of my app.
Does anyone know what could be causing this, or how to resolve it. Cheers