我正在努力实现这样的事情:
我发现了一些与我有关的问题:
大多数答案建议通过调整其阴影来修改UILabel's
图层属性,问题已过时。
我使用以下代码尝试了这些建议:
myLabel.layer.shadowColor = UIColor.black.cgColor
myLabel.layer.shadowOffset = .zero
myLabel.layer.shadowRadius = 2.0
myLabel.layer.shadowOpacity = 1.0
myLabel.layer.masksToBounds = false
myLabel.layer.shouldRasterize = true
得到以下结果:
发光不够强,并且不会分散得更多。我尝试过使用偏移,半径和不透明度但是发光相同或不太明显。
这仍然是可能的还是有人可以向我建议的解决方法?
由于
答案 0 :(得分:1)
将阴影颜色更改为白色:
myLabel.layer.shadowColor = UIColor.white.cgColor