Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reorder UITableView and hide reorder control

My question is like this: Reordering UITableView without reorder control, I use these methods:

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewCellEditingStyleNone;
}
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
    return NO;
}
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath{

}

And

[self.tableView setEditing:YES];

......

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    ItemTableViewCell *cell = (ItemTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"ItemTableViewCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }
    // ...
    cell.showsReorderControl = NO;
    return cell;
}

References: reordering control in UITableView

The result is that the table can be reordered, but the reorder control never hide. So I wonder if I am wrong, or if anybody can help me? Thank you.

like image 908
Smeegol Avatar asked Mar 02 '12 07:03

Smeegol


1 Answers

Check This URL:Reordering a UITableViewCell from any Touch point.This might be helpful to you

like image 90
iosdev1111 Avatar answered Sep 21 '22 18:09

iosdev1111