Faking Subpixel Antialiasing on Text with Core Animation

If you’re using a transparent sheet, you don’t know in advance what the pixels below it will be. They may change. Remember that you have a single alpha channel for all three colors: if you make it transparent, you won’t see any subpixel effect, but if you make it opaque, all three subelements are going … Read more

What does fillMode do exactly?

From the CAMediaTiming protocol documentation: Determines if the receiver’s presentation is frozen or removed once its active duration has completed. This determines what happens at the end of your animation. By default, it is set to kCAFillModeRemoved, which means that the animation changes are undone when the animation is completed. If you switch it to … Read more

Applying multiple transforms to a UIView / CALayer

I realize this doesn’t answer the question entirely (or come close), but if you’re only working with CGAffineTransforms you can use CGAffineTransformConcat() to combine multiple transforms. This will work just fine when some transforms are animated and others are not, as long as you concat the transformations properly. I don’t know how this works when … Read more

How do you explicitly animate a CALayer’s backgroundColor?

You don’t need to wrap CGColorRefs when setting the toValue or fromValue properties of a CABasicAnimation. Simply use the CGColorRef. To avoid the compiler warning, you can cast the CGColorRef to an id. In my sample app, the following code animated the background to red. CABasicAnimation* selectionAnimation = [CABasicAnimation animationWithKeyPath:@”backgroundColor”]; selectionAnimation.toValue = (id)[UIColor redColor].CGColor; [self.view.layer … Read more

Can’t add a corner radius and a shadow

Yes, yes there is… If you want both a corner radius and a drop shadow, you don’t turn on -masksToBounds, but rather set the corner radius and set the bezier path of the shadow with a rounded rect. Keep the radius of the two the same: [layer setShadowOffset:CGSizeMake(0, 3)]; [layer setShadowOpacity:0.4]; [layer setShadowRadius:3.0f]; [layer setShouldRasterize:YES]; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)