[英]How can I detect a right swipe on UITableCell and display a custom button instead of Delete button
I want to display a "Duplicate" button where the Delete button would usually appear if the user swipes from left to right on a UITableView cell. 我想显示一个“重复”按钮,如果用户在UITableView单元格上从左向右滑动,通常会出现“删除”按钮。 I understand I can add a gesture recogniser to the cell as per this example https://stackoverflow.com/a/6167841/2567126 . 我了解我可以按照此示例https://stackoverflow.com/a/6167841/2567126向该单元格添加手势识别器。
How do I create and place a button on the cell so that it appears in a similar manner to the Delete button to allow the user to confirm the action? 如何在单元格上创建和放置一个按钮,使其以类似于“删除”按钮的方式出现,以允许用户确认操作? The cells are just standard UITableViewCells with the default style. 单元格只是具有默认样式的标准UITableViewCells。
您可以使用委托方法- tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:
来更改删除按钮的标题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.