11

On iOS 11 device on deleting a UITableViewCell unexpected white background appears for some reason however all background colors are set to blue in storyboard (works fine on iOS10).

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete)
    {
        [self.bookmarks removeObjectAtIndex:indexPath.row];            
        [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }
}

Tried all types of UITableViewRowAnimation, doesn't solve the problem.

enter image description here

Community
  • 1
  • 1
Pavel Kozlov
  • 993
  • 6
  • 16

3 Answers3

13

Try it (you can choose appearanceWhenContainedInInstancesOfClasses instead).

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    ...

    [[UITableViewCell appearance] setBackgroundColor:[UIColor clearColor]];

    return YES;
}
Milch
  • 156
  • 1
  • 4
1

I tried everything that's possible and only thing that work was

adding

UITableViewCell.appearance().backgroundColor = UIColor.clear

in didFinishLaunchingWithOptions

Iraniya Naynesh
  • 1,125
  • 3
  • 14
  • 26
0

Just a suggestion: Make sure all elements have a transparent background color or the light blue you are using. Apparently there is one that still has a white background color, could be the cell content view (if you have one) or the cell background.

Jorge Irún
  • 1,683
  • 1
  • 15
  • 13