如何在编辑模式下在UITableViewCell中设置自定义编辑样式图标

Mar*_*pic 5 iphone cocoa-touch editmode uitableview

在启用编辑模式时,是否有任何方法可以使用自定义编辑样式图标(绿色加号和红色减号图标除外)UITableView

我知道我可以模拟编辑模式动画,只是向右移动单元格内容并添加UIImageView,但我试图避免这种情况.

ger*_*ry3 6

自定义单元格编辑样式的唯一方法是使用tableView:editingStyleForRowAtIndexPath:必须返回UITableViewCellEditingStyle.

无,删除(红色减号)和插入(绿色加号)是唯一选项.从文档:

细胞编辑风格

单元格使用的编辑控件.

typedef enum {   
UITableViewCellEditingStyleNone,   
UITableViewCellEditingStyleDelete,   
UITableViewCellEditingStyleInsert  
} UITableViewCellEditingStyle;
Run Code Online (Sandbox Code Playgroud)

  • 顺便说一下 - 这是第三个选项叫做"multi-select",editStyle = 3.这是**未记录的**功能. (6认同)
  • 查看Jeff LaMarche撰写的_Table View多行编辑模式_博客文章:http://iphonedevelopment.blogspot.com/2008/10/table-view-multi-row-edit-mode.html (2认同)