【问题标题】:How to add another button beside Delete button, when TableViewCell is swiped? [duplicate]滑动 TableViewCell 时,如何在删除按钮旁边添加另一个按钮? [复制]
【发布时间】:2013-11-14 21:25:06
【问题描述】:

这是添加删除按钮的代码:

 (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{

    return YES;
}


(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {

        NSLog(@"delete pressed");

    }
    else if (editingStyle == UITableViewCellEditingStyleInsert) {

    }
}

【问题讨论】:

标签: ios objective-c uitableview


【解决方案1】:

使用 UITableViewCell 无法做到这一点,您需要创建自己的自定义 UITableViewCells 并在单元格进入编辑模式时自行布置这些视图。

【讨论】:

猜你喜欢
  • 2011-07-05
  • 2013-09-16
  • 2016-03-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多