IOS滑动删除和多行编辑导致按钮名称设置为默认

Posted

技术标签:

【中文标题】IOS滑动删除和多行编辑导致按钮名称设置为默认【英文标题】:IOS swipe to delete and multiple row editing cause the button names set to default 【发布时间】:2012-07-29 04:05:29 【问题描述】:

好吧,我在编辑过程中使用多项选择并同时滑动删除功能..我想要的是当单击选择按钮时,将其标题更改为取消并将颜色设为红色..

而发生在我身上的是标题仍然保留为editdone。我做错了什么?

-(void)setEditing:(BOOL)editing animated:(BOOL)animated 

    if (editing) 
        self.tableView.allowsMultipleSelectionDuringEditing = YES;
        self.editButtonItem.title = @"Cancel";
        self.editButtonItem.tintColor = [UIColor redColor];
      else 
        self.tableView.allowsMultipleSelectionDuringEditing = NO;
        self.editButtonItem.title = @"Select";
        self.editButtonItem.tintColor = nil;
    

    [super setEditing:editing animated:animated];
    self.tableView.allowsMultipleSelectionDuringEditing = editing;


【问题讨论】:

没有人??大声笑..一定很混乱 是的,你的问题还不够清楚!什么是“editButtonItem”? 【参考方案1】:

我不太确定是什么绊倒了。你的问题不够清楚。我会在这里尝试一下,建议你使用这个委托方法。

- (NSString *)tableView:(UITableView *)tableView 
   titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath

    return @"New name for swipe button";
 

【讨论】:

以上是关于IOS滑动删除和多行编辑导致按钮名称设置为默认的主要内容,如果未能解决你的问题,请参考以下文章