刷UITableViewCell时,如何在删除按钮旁边添加另一个按钮?

时间:2013-11-04 09:21:39

标签: ios objective-c uitableview

以下是添加删除按钮的代码:

 (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) {

    }
}

1 个答案:

答案 0 :(得分:0)

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