ios tableview怎么才能侧滑删除

2025-05-17 20:43:03
推荐回答(2个)
回答(1):

单击“开始→运行”并输入“Regedit”打开注册表编辑器,然后“HKEY_CURRENT_USER\Software\Microsoft\Windows\Current Version\Policies\Explorer”子键,最后将其下的键值名为“NoDrives”的键值删除即可。第一招:修改注册表来隐藏逻辑硬盘 1、隐藏“我的电脑”中的磁盘驱动器图标 操作步骤如下: ①“开始”→“运行”中输入regedit,打开注册表编辑器。 ②进入HKEY_CURRENT_USER\SoftWare\microsoft\Windows\CurrentVersion\Policies\Explorer分支中。 ③在右窗口中新建一个二进值的键值名为“NoDrives”,磁盘驱动器所一一对应的键值如下:A驱为“01000000”,B驱为“02000000”,C驱为“04000000”,D驱为“08000000”,E驱为“10000000”,F驱为“20000000”。

回答(2):

这个开发者做了这个功能才行的,
您要是开发者的话
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return true
}

func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {

let deleteRoWAction = UITableViewRowAction.init(style: .destructive, title: "删除") { (action, index) in
print("点击删除")

self.dataArray.remove(at: indexPath.row)
tableView.deleteRows(at: [indexPath], with: .automatic)
}

return [deleteRoWAction]
}