首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >滑动操作总是有删除

滑动操作总是有删除
EN

Stack Overflow用户
提问于 2017-10-24 05:51:54
回答 1查看 59关注 0票数 1

每次我尝试添加一个要删除的操作时,仍然会出现卷帘删除。

代码语言:javascript
复制
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])


}
EN

回答 1

Stack Overflow用户

发布于 2017-10-24 05:57:32

固定

代码语言:javascript
复制
override func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCellEditingStyle {
    return .none
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46899102

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档