本文介绍了如何自定义UITableview的右边框,上边框和下边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何快速在UITableview上用颜色设置右,左,上和下边框?
How can I set right, left, top and bottom border with color on UITableview in swift?
谢谢
推荐答案尝试使用完整边框:
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这是底部边框:
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更多推荐
如何自定义UITableview的右边框,上边框和下边框?
发布评论