いくつかのセルを含むテーブルビューがあります。ユーザーがテーブルを編集できるように、次のコードを実装しました。
ユーザーが編集を開始したときにセルをフェードさせるにはどうすればよいですか?
- (BOOL) tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
selectedCell.alpha = 0.1;
if ( editingStyle == UITableViewCellEditingStyleDelete)
{[XC1 removeObjectAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
セルをフェードさせるために追加した現在のコードは機能しません!
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
selectedCell.alpha = 0.1;
誰かが私を助けてくれることを願っています!