我想在表格視圖單元格周圍添加邊框。以下是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
從我最近的回答中嘗試解決方案... –