我试图给标签文本添加阴影,但不显示。标签阴影不能在swift中工作
我的代码
private func drawValueLabel() {
valueLabel.layer.shadowColor = UIColor.red.cgColor
valueLabel.layer.shadowOffset = CGSize.init(width: 15.0, height: 15.0)
valueLabel.layer.shadowRadius = 3.0
valueLabel.layer.shadowOpacity = 1
valueLabel.layer.masksToBounds = false
valueLabel.clipsToBounds = false
valueLabel.layer.shouldRasterize = true
valueLabel.drawText(in: self.bounds)
}
帮我展现阴影
感谢
你的代码是好的,正确的 –
https://stackoverflow.com/questions/44367129/uitableviewcell-shadows/44367371#44367371 –