J'ai appliqué une image semi-transparente à mon UITableViewCell.contentView. Chaque fois que j'ajouter mon accessoryView personnalisé, il ne dispose pas de l'arrière-plan à droite comme indiqué ici:Arrière-plan cohérent pour UITableViewCell
Voici le code correspondant:
UITableViewCell *tableViewCell = [[UITableViewCell alloc] init];
[tableViewCell.contentView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"cell-bg.png"]]];
//[tableViewCell.backgroundView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"cell-bg.png"]]];
tableViewCell.textLabel.text = @"Test";
UIButton *accessoryButton = [UIButton buttonWithType:UIButtonTypeCustom];
[accessoryButton setBackgroundImage:[UIImage imageNamed:@"arrow.png"] forState:UIControlStateNormal];
[accessoryButton setFrame:CGRectMake(0, 0, 34, 34)];
tableViewCell.accessoryView = accessoryButton;
J'ai aussi essayé d'ajouter l'image d'arrière-plan à backgroundView
au lieu de contentView
, mais il n'apparaît pas du tout. Comment résoudre ceci? Merci