我有一个小问题。
如何使用滑动删除单元格按钮,如iOS 9邮件应用程序(图像+文本)?
我找到了这种方法,但我的图像是白色的,如果我这样做,我就无法改变背景颜色:
override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
let deleteButton = UITableViewRowAction(style: .Destructive, title:"\nDelete", handler: { (action, indexPath) in
self.tableView.dataSource?.tableView?(self.tableView,commitEditingStyle: .Delete,
forRowAtIndexPath: indexPath)
return
})
deleteButton.backgroundColor = UIColor(patternImage: UIImage(named: "icon")!)
return [deleteButton]
}
谢谢:)