How to set the colors in glowing effect of a UILabel?

青春壹個敷衍的年華 提交于 2019-12-06 08:08:55

问题


We can typically set fontColor of a UILabel by:

label.textColor = self.someTextColor;

and the shadow (glow) by:

label.layer.shadowColor = self.someGlowColor;
label.layer.shadowOffset = CGSizeMake(0.0, 0.0);
label.layer.shadowRadius = 3.0;
label.layer.shadowOpacity = 0.5;

It'ok for simple shadow. However, how can I set the font color with some fancy glowing effect? For example:

Provided A is the color at center, B is color at font boundary, and C the glow effect. How can I use iOS API to achieve the effect as shown in the diagram?

来源:https://stackoverflow.com/questions/22875584/how-to-set-the-colors-in-glowing-effect-of-a-uilabel

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