
在cell添加了一个View,充当分割线,但是在点击的时候会出现闪的情况。
解决方法:去掉分割线的View。通过override func draw(_ rect: CGRect)
进行绘制一条分割线
override func draw(_ rect: CGRect) {
//获取绘图上下文
guard let context = UIGraphicsGetCurrentContext() else {
return
}
context.setFillColor(UIColor.init(hexString: "#F2F2F2").cgColor)
context.fill(CGRect.init(x: 0, y: 135, width: Tools.screenWidth(), height: 8))
}
最后效果

网友评论