//先在tableviewcontroller里 把系統(tǒng)自帶的分割線隱藏
tableView.separatorStyle=UITableViewCellSeparatorStyle.none
//復(fù)寫分割線 ?在自己定義的cell里 重寫drawrect方法
overridefuncdraw(_rect:CGRect) {
letcontext:CGContext=UIGraphicsGetCurrentContext()!
context.setFillColor(UIColor.clear.cgColor)
context.fill(rect)
context.setStrokeColor(UIColor.black.cgColor)
context.stroke(CGRect(x:0, y:-0.3, width: rect.size.width, height:0.3))
context.setStrokeColor(UIColor.black.cgColor)
context.stroke(CGRect(x:0, y: rect.size.height, width: rect.size.width, height:0.3))
}