【发布时间】:2016-12-26 07:35:26
【问题描述】:
我正在寻找一种在编辑单元格时更改标签颜色的方法。默认颜色为白色,当我滑动删除时会显示该颜色,但我想将其更改为黑色,就像 Apple News 应用程序一样,如下图所示。
这是编辑代码的常用滑动:
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,但 swift 甚至 ObjC 中的任何东西都会很酷。谢谢。 ;)
【问题讨论】:
标签: ios swift uitableview swift3