我想在表格视图单元格周围添加边框。以下是cellForRowAtIndexPath
代码:UITableViewCell右侧的边框不可见
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
cell.separatorInset.left = 20.0
cell.separatorInset.right = 20.0
cell.separatorInset.top = 20.0
cell.separatorInset.bottom = 20.0
cell.layer.borderWidth = 3
cell.layer.cornerRadius = 20.0
cell.layer.borderColor = UIColor.colorWithHexString("80CBC4").CGColor
return cell
}
检查单元格宽度。 –
已经为单元格视图定义了“宽度”和“高度”约束 – triandicAnt
从我最近的回答中尝试解决方案... –