How to draw a drop shadow AND gradient with quartz2d?

我与影子孤独终老i 提交于 2019-12-11 06:26:35

问题


I've a custom shape drawing using coregraphics and i want to add a drop shadow and a gradient to it also. I've been trying and searching a lot of informations on how to combine and do this, but i can't get it to work. I'm able to draw only one either. Anyone doing this already or know how to do this? Thank you.


回答1:


Quartz only applies shadows to fills and strokes. Drawing a gradient does not count as a fill.

Fill with a solid color (to draw the shadow), then draw the gradient in the same area.



来源:https://stackoverflow.com/questions/2577622/how-to-draw-a-drop-shadow-and-gradient-with-quartz2d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!