我试图改变默认按钮来删除tableview中的一行(当用户向左滑动时)。 Changing the height of the default confirmation delete button自定义UITableViewCell中的默认删除按钮和图标
同时我想进入编辑模式时,对细胞的左侧添加自定义图像... [进入编辑模式时,更改默认的图标删除2
我已经包括在我的代码:
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return true
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
}
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let delete = UITableViewRowAction(style: .destructive, title: "\u{267A}\n Delete") { (action, indexPath) in
tableView.isEditing = false
print("delete")
// delete item at indexPath
}
return [delete]
}
是有可能改变的确认的唤起注意删除按钮,添加自定义图像左侧的图标?
谢谢! :)
是的,这是可能的。你可以再次检查网站。该问题已被问及以前的答案 – SaiPavanParanam
可能会有所帮助:https://stackoverflow.com/a/35648526/1457385 – shallowThought
我见过答案...肯定我做smt错误....我插入图像...但按钮的高度仍然是行的相同...我想要做的是改变按钮的高度,并使其不同于行的高度.. – Marco