1
我試圖將陰影效果添加到UITableViewCell.selectedBackgroundView
但這不顯示。當我設置背景顏色時,我可以看到添加了這個顏色,所以在設置陰影時出現了一些問題。這是我的代碼,低於cellForRowAtIndexPath
。如何將陰影添加到selectedBackgroundView UITableViewCell Swift
///Setting selected UIView
let selectedView = UIView(frame: cell.frame)
selectedView.layer.shadowOpacity = 0.35
selectedView.layer.shadowOffset = CGSizeMake(0, 2)
selectedView.layer.shadowRadius = 5
selectedView.layer.shadowColor = UIColor.blackColor().CGColor
selectedView.clipsToBounds = false
cell.selectedBackgroundView = selectedView
cell.contentView.clipsToBounds = false
cell.clipsToBounds = false
試圖把這個didselectrowAtIndexPath? – Happiehappie
我認爲這個影子被下一個單元所隱藏... – Lumialxk
@Happiehappie現在嘗試過,但仍然沒有運氣 –