How do you create a DropShadow on a UIView
Posted
by Arpit
on Stack Overflow
See other posts from Stack Overflow
or by Arpit
Published on 2010-04-19T21:43:30Z
Indexed on
2010/04/19
21:53 UTC
Read the original article
Hit count: 807
My current code doesnt seem to do anything:
CGContextRef currentContext = UIGraphicsGetCurrentContext(); CGContextSaveGState(currentContext);
float myColorValues[] = {1.0, 0, 0, .8};
CGColorSpaceRef myColorSpace = CGColorSpaceCreateDeviceRGB();
CGColorRef myColor = CGColorCreate(myColorSpace, myColorValues);
CGContextSetShadowWithColor (currentContext, CGSizeMake(-1, -1), 0, myColor);
//CGContextSetShadow(currentContext, CGSizeMake(-15, 20), 15);
[super drawRect: rect];
CGContextRestoreGState(currentContext);
© Stack Overflow or respective owner