Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What is happening is that when UITableViewCell shows the reorder control it also adds an empty, 1 pixel wide, white UIView to its array of subviews.</p> <p>Bluntly: this is a bug that Apple should fix.</p> <p>However, you can get around it by finding that annoying view every time it appears and setting its background color to transparent. <strong>Quick tip</strong>: the annoying white view is always the last in the UITableViewCell's subviews array and is always 1 pixel wide. We will use this to find it.</p> <p>When you turn editing on for the table, make all of the visible annoying 1 pixel views transparent. So the action method which toggles "edit" mode on the table might look like this:</p> <pre><code>- (IBAction)edit:(id)sender { [tableView setEditing:!tableView.editing animated:YES]; for (UITableViewCell *cell in [tableView visibleCells]) { if (((UIView *)[cell.subviews lastObject]).frame.size.width == 1.0) { ((UIView *)[cell.subviews lastObject]).backgroundColor = [UIColor clearColor]; } } } </code></pre> <p>and keep doing so for all new views as they become visible by implementing this in your UITableViewDelegate:</p> <pre><code>- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell] forRowAtIndexPath:(NSIndexPath *)indexPath { if (((UIView *)[cell.subviews lastObject]).frame.size.width == 1.0) { ((UIView *)[cell.subviews lastObject]).backgroundColor = [UIColor clearColor]; } } </code></pre> <p>This hack to fix the problem is fairly innocuous and if Apple fix the bug in future (stop adding the annoying 1 pixel view), this code should quietly stop doing anything.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload