Background problem on UITableView

Posted by f0rz on Stack Overflow See other posts from Stack Overflow or by f0rz
Published on 2010-04-15T07:28:33Z Indexed on 2010/04/15 7:33 UTC
Read the original article Hit count: 277

Hi !

I have come to a problem, wich I have no idea how to solve. Can anyone think outside the box and point me to right directions? I would be very thankfull !

The problem.
I have a UITableView containing a first row wich is always the same (a empty row with repeating background) Next rows are bounch of dynamic data rows. I have set the yellow background on my UITableView in IBuilder, My cells (except first row) have white background with code:

     UIView* backgroundView = [ [ [ UIView alloc ] initWithFrame:CGRectZero ] autorelease ];
 backgroundView.backgroundColor = [UIColor colorWithRed: 0.96078431372549 green: 0.96078431372549 blue: 0.96078431372549 alpha: 1.0];
 cell.backgroundView = backgroundView;
 for ( UIView* view in cell.contentView.subviews ) 
 {
  view.backgroundColor = [ UIColor clearColor ];
 }

alt text

The example yellow background, I only want to be showed at the top. As u see img example below. The thing is I dont want to have yellow background under the last datarow, I want to contain same white color I have on the cells.

alt text

This should be white as the cells. Not yellow.

alt text

Thank u for your time. Regards

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about cocoa-bindings