title: Why do all backgrounds disappear on UITableViewCell select?
body: <p>My current project's UITableViewCell behavior is baffling me. I have a fairly straightforward subclass of UITableViewCell. It adds a few extra elements to the base view (via <code>[self.contentView addSubview:...]</code> and sets background colors on the elements to have them look like black and grey rectangular boxes. </p>
  
  <p>Because the background of the entire table has this concrete-like texture image, each cell's background needs to be transparent, even when selected, but in that case it should darken a bit. I've set a custom semi-transparent selected background to achieve this effect:</p>
  
  <pre><code>UIView *background = [[[UIView alloc] initWithFrame:self.bounds] autorelease];
  background.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.6];
  background.opaque = NO;
  
  [self setSelectedBackgroundView:background];
  </code></pre>
  
  <p>And although that yields the right look for the background, a weird side effect happens when I select the cell; all other backgrounds are somehow turnt <em>off</em>. Here's a screenshot. The bottom cell looks like it should and is not selected. The top cell is selected, but it should display the black and grey rectangular areas, yet they are gone!</p>
  
  <p><img src="https://i.stack.imgur.com/e74Uh.png" alt="Screenshot of the simulator. The top cell is selected, the bottom is not."></p>
  
  <p>Who knows what's going on here and even more important: how can I correct this?</p>