title: Vertical space between UITableViewCells after setting the backgroundView on a cell
body: <p>I am implementing UITableViewCells that have a custom background and expands when tapped.</p>
  
  <p>I am setting a custom view as my UITableViewCells backgroundView: (in RowForIndexPath)</p>
  
  <pre><code>if (cell == nil) {
      CGRect f = CGRectMake(0.0f, 0.0f, 300.0f, 50.0f);
  
      cell = [[UITableViewCell alloc] initWithFrame:f reuseIdentifier:cellIdentifier];
  
      UIView *back = [[UIView alloc] initWithFrame:CGRectMake(10.0f, 10.0f, 300.0f, 50.0f)];
      back.layer.cornerRadius = 8.0f;
      [back setBackgroundColor:[UIColor blackColor]];
  </code></pre>
  
  <p>This works fine, by setting the backgroundView instead of the contentView, my backgroundView scales to accommodate the new size of the cell after it expands (changing the height in heightForRowAtIndexPath after a tap).</p>
  
  <p>My problem is now that I would like a few pixels vertical space between my cells. Using the above approach will make the rounded black cells be displayed "back to back".</p>
  
  <p><strong>Is there a way to add the vertical space between the cells or is there a completely different approach I can take to obtain the desired look of my cells?</strong></p>
  
  <p>Thanks in advance.</p>