1、重寫drawRect(rect:CGRect)這個方法
2、將tableview的下劃線設置成none
3、修改下劃線屬性,代碼如下
override func drawRect(rect: CGRect) {
let context = UIGraphicsGetCurrentContext()
CGContextSetFillColorWithColor(context, UIColor.clearColor().CGColor)
CGContextFillRect(context, rect)
println(rect.size.width)
CGContextSetStrokeColorWithColor(context, UIColor.blueColor().CGColor)
CGContextStrokeRect(context, CGRectMake(20, rect.size.height, rect.size.width-40, 1))
}