3
我正在尋找一種在編輯單元格時更改標籤顏色的方法。默認顏色是白色,當我滑動刪除時會顯示這個顏色,但我想將其更改爲黑色,就像蘋果新聞應用程序所做的一樣,如下圖所示。在編輯UITableViewCell時更改標籤顏色
這是一般的刷卡編輯代碼:
override func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let editAction = UITableViewRowAction(style: .normal, title: "Rename") { (action: UITableViewRowAction, indexPath: IndexPath) -> Void in
}
editAction.backgroundColor = UIColor.black
return [editAction]
}
任何想法。我正在使用swift 3,但是任何快速甚至是ObjC都會很酷。謝謝。 ;)
這看起來很有趣。我將在本週末嘗試一下並回復你。 ;) – Gugulethu