我想更改按钮的标题和图像色调颜色,但我无法做到这一点。 没有这样的属性或方法可以改变。
func tableView(_ tableView: UITableView,
trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration?
{
let discardButton = UIContextualAction(style: .normal, title: "DISCARD", handler: { (ac:UIContextualAction, view:UIView, success:(Bool) -> Void) in
print("discardButton action ...")
success(true)
})
discardButton.image = UIImage(systemName: "xmark.circle.fill")
discardButton.backgroundColor = .red
return UISwipeActionsConfiguration(actions: [discardButton])
}
我想更改文本颜色和图像色调颜色。
Shell 我们将按钮重叠到 UITableView Cell 就像这张图片