gpt4 book ai didi

swift - 滑动 Action 总是有删除

转载 作者:搜寻专家 更新时间:2023-11-01 07:08:03 25 4
gpt4 key购买 nike

每次我尝试添加 Action 滑动删除仍然出现。

override func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {


let closeAction = UIContextualAction(style: .normal, title: "Share", handler: { (ac:UIContextualAction, view:UIView, success:(Bool) -> Void) in
print("OK, marked as Closed")

success(true)
})

closeAction.backgroundColor = .blue

return UISwipeActionsConfiguration(actions: [closeAction])


}

最佳答案

固定

override func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCellEditingStyle {
return .none
}

关于swift - 滑动 Action 总是有删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46899102/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com