0
私はテーブルビューを持っていますが、それらのすべてではなくUITableViewCellEditingStyleDelete
を表示したいと思います。条件に基づいて、一部のセルの場合、私はpopover
を削除ボタンのスタイルなしで表示したいと考えています。特定のセルでUITableViewCellEditingStyleDeleteを無効にする
私の現在の実装では、スワイプして削除すると、まだUITableViewCellEditingStyleDelete
とpopover
の両方を見ることができました。
UITableViewCellEditingStyleDelete
を使わずに右から左にスワイプすると、どのように達成できるのですか?popover
self.tableView.allowsMultipleSelectionDuringEditing = NO;
-(void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
if([GlobalFunctions isComboItem:itemId])
{
// Show popover --> done
// hide UITableViewCellEditingStyleDelete --> ?? dont know
}
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
NSString *itemId = [(NSDictionary *)[sharedData.orderItems objectAtIndex:indexPath.row] objectForKey:kItemId];
[GlobalFunctions deleteItemFromOrder:itemId];
[self calculate];
}
}
あなたの質問はAnbu.Karthik @ –
明らかではないが、試してみてください、いくつかのtablecellsがあることを前提としています。ユーザーが右から左にスワイプすると、tableviewセルに削除ボタンが表示されます。しかし、いくつかのセルでは、削除ボタンを表示せずにポップオーバーだけを表示したい。 – hotspring
いくつかの追加コードを追加することができます –