我有经典的TableView,如果你滑动而不是单击按钮,你可以删除项目.我知道如何在单元格上设置自定义背景,但我找不到如何设置自定义字体和颜色.
谢谢你的帮助!
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? {
var deleteAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default,
title: "Delete",
handler: {
(action:UITableViewRowAction!, indexPath:NSIndexPath!) -> Void in
println("Delete button clicked!")
})
deleteAction.backgroundColor = UIColor.redColor()
return [deleteAction]
}
Run Code Online (Sandbox Code Playgroud)