我試圖給標籤文本添加陰影,但不顯示。標籤陰影不能在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 –