UITableView with translucent section headers and various color sections

I am trying to customize a UITableView with layers like this:

diagram

In particular, a table has several sections, and each section has a different background color. To do this, I usually just changed every cell. The tough part is that I would like the section headers to be translucent. When I do this, the background under the heading is the background color in the form of a table when there is no cell under the heading. I could, of course, set the background color as a table, but then the color under each heading would be the same.

How to create a table view as shown in the diagram?

UPDATE. To be absolutely clear, I know how to create a custom header, and know how to make it translucent using the alpha property. The problem is that under the gaze. I need what is under the background color of the section, and not the background color in the form of a table.

+5
source share
2 answers

, backgroundView. . . contentSize contentOffset , . rectForSection: . .

, , . , .

+1

UIImageView () .

- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section           {

      UIView * junkView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"headerImageBackground.png"]];
      junkView.alpha = .3;
      [junkView autorelease];
      return junkView;
 }
+1

All Articles