xcode UILabel文本添加外部发光效果 [英] xcode UILabel text add outer glow effect

查看:193
本文介绍了xcode UILabel文本添加外部发光效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为UILabel的文本添加外发光效果。我尝试使用layer.shadow ...属性,但它们实际上只是一个阴影。

How would I add an outer glow effect to a text of a UILabel. I tried to use the layer.shadow... properties but they are really just for a drop shadow.

_count.backgroundColor = [UIColor clearColor];
_count.layer.masksToBounds = NO;
_count.layer.shadowOpacity = .8;
_count.layer.shadowRadius = 5.0;
_count.layer.shadowColor = [UIColor whiteColor].CGColor;
_count.layer.shadowOffset = CGSizeMake(0.0, 0.0);

谢谢

推荐答案

所以我确定没有办法在文本上加上这种效果,有方法可以像问题中提到的那样进行内部发光或阴影投影,但是(我可以找到)没有办法添加外部发光到文本。我最终在文本后面添加了png,以完成类似的效果(但并不是我想要的效果)。

So I determined there was no way to put this kind effect on text there are ways to do an inner glow or a drop shadow as mentioned in the question but no way (that I can find) to add an outer glow to text. I ended up adding a png behind the text to complete a similar (yet not exactly what I was looking for) effect.

这篇关于xcode UILabel文本添加外部发光效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆