简体   繁体   English

点击单元格时如何显示tableview单元格编辑视图?

[英]How to show tableview cell edit view when tap the cell?

My requirement is show the tableviewcell edit view when tap the cell. 我的要求是在点击单元格时显示tableviewcell编辑视图。 The "editActionsForRowAtIndexPath" is working when swipe but i want this action when tap the cell. 滑动时“editActionsForRowAtIndexPath”正在工作但我在点击单元格时需要此操作。 enter image description here 在此输入图像描述

I don't know what you use for swipe. 我不知道你用什么刷卡。 But if you want to handle some actions when the user tap the cell you should use didSelectRowAtIndexPath function. 但是,如果您想在用户点击单元格时处理某些操作,则应使用didSelectRowAtIndexPath函数。 For example; 例如;

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    print("Tapped")
}

Use this code on didselect delegate method, I think it will be help you. 在didselect委托方法上使用此代码,我认为它会对您有所帮助。

self.tableView.editing = true self.tableView.editing = true

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在TAP上而不是滑动上编辑TableView单元格-Swift - How to edit tableview cell on TAP instead of swipe - Swift 当我点击表格视图时,如何在第二视图中显示collectionview在第一视图中的任何单元格 - how to display collectionview in second view when i tap on tableview any cell in first view 将TableView点击位置转换为单元格视图位置 - Transform TableView Tap Location to Cell View Location 当用户点击 tableView 单元格时如何移动到其他视图控制器 - How to move to other viewControllers when user tap on a tableView cell 如何在按钮单击同一单元格内时隐藏/显示自定义tableview单元格内的特定视图 - how to hide/show a specific view inside the custom tableview cell when button click inside the same cell 如何在另一个View Controller中使用核心数据编辑Tableview单元格数据 - How To Edit Tableview Cell Data with Core Data In Another View Controller Swift:如何在TableView中点击时模糊单元格 - Swift : how to blurry a cell on tap in tableView 如何为静态 TableView 单元格点击添加动作? - How to add Action for Static TableView Cell tap? 滑动以显示Tableview单元格中的编辑操作时,如何保持文本标签的可见性? - How to keep text label in view when swiping to reveal edit actions in tableview cell? 如何在用户点击静态tableview单元格时启用编辑模式? - How to enable edit mode when user taps static tableview cell?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM