从单元格滑动操作中消除警报后冻结单元格的UI

时间:2018-09-05 09:42:07

标签: ios objective-c uitableview

我正在使用trailingSwipeActionsConfigurationForRowAtIndexPath配置在单元格结尾处的滑动操作。从右到左(打开动作)和从左到右(关闭动作)滑动单元格是完美的工作。

但是当我打开任何警报(或任何类型的模型演示或任何弹出窗口)时,关闭警报或弹出窗口后,对应的单元格将被冻结。即我无法从左向右滑动(关闭操作)。我尝试从该特定索引重新加载单元格,单元格是帧正在回退,但是ui的那些动作仍然停留在顶部。

- (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath  API_AVAILABLE(ios(11.0)) {
    if (@available(iOS 11.0, *))
        return [self mySellSheetContextualActionsForIndexPath:indexPath];
    return nil;
}

- (UISwipeActionsConfiguration *)mySellSheetContextualActionsForIndexPath:(NSIndexPath *)indexPath {
    NSMutableArray *contextualActions = [[self mySellSheetActionsForIndexPath:indexPath] valueForKeyPath:@"contextualAction"];
    UISwipeActionsConfiguration *swipeActionsConfiguration = [UISwipeActionsConfiguration configurationWithActions:contextualActions];
    swipeActionsConfiguration.performsFirstActionWithFullSwipe = NO;
    return swipeActionsConfiguration;
}

0 个答案:

没有答案