我想知道是否有人有字体发光效果的例子?我试图查看 NSAttributedString ,但在属性中找不到发光文本。
问问题
702 次
1 回答
2
尝试这个:
#include <Quartzcore/Quartzcore.h>
.......
yourLabel.layer.shadowColor = [[UIColor glowColor] CGColor]; //Replace glowColor with the desired color (redColor, greenColor, etc.)
yourLabel.layer.shadowOffset = CGSizeMake(0.0, 0.0); //The glow starts from the center
yourLabel.layer.shadowRadius = 20.0; //You can change this to the desired amount
yourLabel.layer.shadowOpacity = 0.5; //You can change this to the desired amount
yourLabel.layer.masksToBounds = NO; //Keep this the same to avoid shadow being clipped by the label bounds
希望这可以帮助!
于 2012-06-21T21:20:15.727 回答