我有一个带有阴影的单元格的 UITableView。当我做出平移手势以查看任何单元格的行操作时,表格视图会剪辑单元格的边界,直到手势完成。
我已经clipsToBounds设置为false我的单元格contentView和它的父,也为表视图。
我的自定义单元格代码:
var isExpanded: Bool = false
@IBOutlet weak var shadowView: UIView!
@IBOutlet weak var fullContainer: UIView!
override func awakeFromNib() {
super.awakeFromNib()
reloadUI()
}
func reloadUI() {
contentView.superview?.clipsToBounds = false
contentView.clipsToBounds = false
fullContainer.layer.masksToBounds = true
fullContainer.layer.cornerRadius = 8
shadowView.layer.masksToBounds = false
shadowView.layer.cornerRadius = 8
shadowView.layer.shadowOpacity = 1.0
shadowView.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
shadowView.layer.shadowPath = UIBezierPath(roundedRect: fullContainer.bounds, cornerRadius: 8).cgPath
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated) …Run Code Online (Sandbox Code Playgroud)