好吧,我在编辑过程中使用多项选择并同时滑动以删除功能..我想要的是单击选择按钮时,将其标题更改为取消并将颜色设为红色..
而我的情况是标题仍然保留为edit
和 done
.我究竟做错了什么?
-(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;
}
最佳答案
我不太确定是什么绊倒了。你的问题不够清楚。我会在这里尝试一下,并建议你使用这个委托(delegate)方法。
- (NSString *)tableView:(UITableView *)tableView
titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
return @"New name for swipe button";
}
关于objective-c - IOS滑动删除和多行编辑导致按钮名称设置为默认,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11706549/