我想知道是否有办法阻止“清除”按钮出现在特定的 uitableviewcell 上并让它出现在另一个上?
我已经设置了一个自定义的 uitableview 单元,其中有一个按钮,我正在使用
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
方法..我想知道当用户滑动删除时,您是否可以停止出现在几个 uitableviewcells 之一上的按钮?
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
return @"Clear";
}
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0)
{
//cell fade - notifies the user that they are edited their cell
NSArray *rowArray = [NSArray arrayWithObject:indexPath];
[self.tableView reloadRowsAtIndexPaths:rowArray withRowAnimation:UITableViewRowAnimationFade];
if (indexPath.row == 0)
{
manufactureSearchObjectString = @"empty";
[self.tableView reloadData]; //reloads the tabel with new value
manufactureResultIndexPath = nil; //removes tick from subview
}
else if (indexPath.row == 1)
{
}
else if (indexPath.row == 2)
{
}
else if (indexPath.row == 3)
{
keyTypeSearchObjectString = @"empty";
[self.tableView reloadData]; //reloads the tabel with new value
keyTypeResultIndexPath = nil; //removes tick from subview
}
}
else if (indexPath.section == 1)
{
if (indexPath == 0)
{
//can I stop the "clear" button from showing in here?
}
}
}
更具体地说,我想阻止这种情况发生