Drop Shadow on UITextField text

DotSlashSlash picture DotSlashSlash · Aug 13, 2009 · Viewed 55.5k times · Source

Is it possible to add a shadow to the text in a UITextField?

Answer

egarc picture egarc · Oct 29, 2010

As of 3.2, you can use the CALayer shadow properties.

_textField.layer.shadowOpacity = 1.0;   
_textField.layer.shadowRadius = 0.0;
_textField.layer.shadowColor = [UIColor blackColor].CGColor;
_textField.layer.shadowOffset = CGSizeMake(0.0, -1.0);