mardi 3 mars 2015

Placing UIActivityIndicator in a cell when editing UITableViewCell and disable UserInteraction

enter image description here


When the user clicks on delete button in my case "Radera" a UIActivityIndicator is shown in the middle of the tableView since i could not think of a way to put it in the middle of the deleted Cell. This is the code that i am using right now:



- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {

self.activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
//cell.accessoryView = self.activityView;


self.activityView.center = self.tableView.center;
[self.tableView addSubview:self.activityView];

[self.activityView startAnimating];
.... rest of the code


So 1)


first question how to put the indicatorView in the middle of the deleting cell


2) Is there anyway to disable the delete button while this is happening? I dont want the user to massclick the button.




Aucun commentaire:

Enregistrer un commentaire