Created
December 19, 2011 17:02
-
-
Save codeswimmer/1497988 to your computer and use it in GitHub Desktop.
iOS: How to draw shadowed text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // How to draw shadowed text | |
| // color = [[UIColor orangeColor] CGColor]; best to cache this | |
| CGContextSaveGState(context); | |
| CGFloat shadowHeight = 2.0; | |
| CGContextSetShadowWithColor(context, CGSizeMake(1.0, -shadowHeight), 0.0, <color>); | |
| [<string>, drawInRect:<rect> withFont:<font>]; | |
| CGContextRestoreGState(context); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment