简体   繁体   中英

UIBezierPath Shadow effect

Currently I am working on a paint app for iOS. I am stuck with applying shadow effect to a particular drawn path. I have use UIBezierpath to draw paths. Is there any way to apply shadow effect on UIBezierpath?

CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [[UIColor whiteColor] CGColor]);
CGContextSetShadowWithColor(context, CGSizeMake(0, 5), 5.0, [[UIColor blackColor]CGColor]);
CGContextDrawPath(context, kCGPathFill);

Something like this may help u..

CGContextSetShadowWithColor(context, CGSizeZero, 20, [path.color CGColor]) 

我想这可能会帮助你显示阴影效果

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM