ios - How do I customize a UITableview right, top and bottom border? -
how can set right, left, top , bottom border color on uitableview in swift?
thanks,
try full border:
yourtable.layer.maskstobounds = true yourtable.layer.bordercolor = uicolor( red: 153/255, green: 153/255, blue:0/255, alpha: 1.0 ).cgcolor yourtable.layer.borderwidth = 2.0
this bottom border:
let border = calayer() let width = cgfloat(2.0) border.bordercolor = uicolor.darkgraycolor().cgcolor border.frame = cgrect(x: 0, y: yourtable.frame.size.height - width, width: yourtable.frame.size.width, height: yourtable.frame.size.height) border.borderwidth = width yourtable.layer.addsublayer(border) yourtable.layer.maskstobounds = true
Comments
Post a Comment