Skip to content

Instantly share code, notes, and snippets.

@xdream86
Created August 25, 2013 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xdream86/6331776 to your computer and use it in GitHub Desktop.
Save xdream86/6331776 to your computer and use it in GitHub Desktop.
- (void)drawRect:(CGRect)rect {
CGContextRef ctx = UIGraphicsGetCurrentContext();
UIGraphicsPushContext(ctx);
CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); // white color
CGContextSetShadow(ctx, CGSizeMake(2.0f, 2.0f), 2.0f); //也可以使用CGContextSetShadowWithColor (myContext, myShadowOffset, 5, myColor);
CGContextFillEllipseInRect(ctx, CGRectMake(10.0f, 10.0f, 100.0f, 100.0f)); // a white filled circle with a diameter of 100 pixels, centered in (60, 60)
UIGraphicsPopContext();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment