Wal*_*est 4 uitableview ios swift
我的UITableView中的某些行需要删除并在编辑模式下移动,但有些行只是移动.在这种方法中,我可以启用或禁用某些行的编辑
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool{
return true
}
Run Code Online (Sandbox Code Playgroud)
但是如何在启用移动的情况下禁用某些行的删除?
返回.None为editingStyleForRowAtIndexPath:
func tableView(tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyle {
return .None
}
Run Code Online (Sandbox Code Playgroud)
这里有一个更完整的答案,显示如何删除缩进 - > 编辑UITableView时有没有办法隐藏" - "(删除)按钮
| 归档时间: |
|
| 查看次数: |
1162 次 |
| 最近记录: |