如何在编辑模式下在 UITableViewCell 中设置自定义编辑样式图标
在 UITableView 中启用编辑模式时,有没有办法拥有自定义编辑样式图标(除了绿色加号和红色减号图标之外)?
我知道我可以模拟编辑模式动画,只需将单元格内容移动到右侧并添加 UIImageView,但我试图避免这种情况。
Is there any way to have a custom edit-style icon (besides the green plus and red minus icons) when enabling edit-mode in a UITableView
?
I know I could simulate the the edit-mode animation and just move the cell contents to the right and add a UIImageView, but I was trying to avoid that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自定义单元格编辑样式的唯一方法是使用 tableView:editingStyleForRowAtIndexPath: ,它必须返回 UITableViewCellEditingStyle。
无、删除(红色减号)和插入(绿色加号)是唯一的选项。来自 文档:
The only way to customize the editing style of a cell is using tableView:editingStyleForRowAtIndexPath: which must return a UITableViewCellEditingStyle.
None, delete (red minus), and insert (green plus) are the only options. From the documentation:
可以按照下面的代码返回
You can return as shown in below code