Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 滑动单元格以删除显示两个按钮,但需要一个_Ios_Uitableview - Fatal编程技术网

Ios 滑动单元格以删除显示两个按钮,但需要一个

Ios 滑动单元格以删除显示两个按钮,但需要一个,ios,uitableview,Ios,Uitableview,我有一个自定义UITableViewCells的TableView,当我滑动单元格以显示按钮时,我会得到两个类似这样的按钮- 但需要一个按钮——“删除”。。。 我做错了什么? 单元格是自定义的…但我不添加灰色按钮 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath*)indexPath{ // Return NO if you do not want the specified item t

我有一个自定义UITableViewCells的TableView,当我滑动单元格以显示按钮时,我会得到两个类似这样的按钮-

但需要一个按钮——“删除”。。。 我做错了什么? 单元格是自定义的…但我不添加灰色按钮

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath*)indexPath{
// Return NO if you do not want the specified item to be editable.
return YES;}

我明白了。我没有看到,我添加的功能没有文档化,这是第二个按钮-

-(NSString *)tableView:(UITableView *)tableView titleForSwipeAccessoryButtonForRowAtIndexPath:(NSIndexPath *)indexPath;{
return @"";}

您只需在委托方法中返回
UITableViewCellEditingStyleDelete

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewCellEditingStyleDelete;
}