我有一个UITableView,我已经为它添加了编辑操作。现在我想在删除按钮标签上方添加图像,如下所示:
这是我的代码:
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
let blockAction = UITableViewRowAction(style: .Normal, title: "Block") { (rowAction:UITableViewRowAction, indexPath:NSIndexPath) -> Void in
//TODO: Delete the row at indexPath here
}
blockAction.backgroundColor = UIColor.redColor()
return [blockAction]
}
如何在我的删除
按钮上添加图片?
UITableViewDelegate
提供的标准API。 - rmaddyhttps://dev59.com/HF0b5IYBdhLWcg3wUP0X如果您使用的是iOS8+系统。 - sbsr