我搜索几篇文章,但我找不到我要找的东西.基本上,我想在每一行显示删除按钮,但我不想使用UITableView.editing属性.
因为它看起来像这样;
因为它看起来像这样;
谢谢你的建议.
- - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
- // Return YES if you want the specified item to be editable.
- return YES;
- }
- - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
- if (editingStyle == UITableViewCellEditingStyleDelete) {
- //Do something...
- }
- }
- - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView
- editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
- return UITableViewCellEditingStyleDelete;
- }