0

I made a custom cell for a UITableView (subclassing UITableViewCel, e..., and with a xib). In IB, i set the background color of the myUITableViewCell to a light grey. Simulated into IB (with a run), the cell looks great (a full grey even under the disclosure button). But when I run the application, the cell keeps showing a white background. Do you know why this happens ?

May I have to do this programmaticaly to make it work ?

Daniyar
  • 2,975
  • 2
  • 26
  • 39
Oliver
  • 23,072
  • 33
  • 138
  • 230

3 Answers3

0

Do you init the cell with initWithNibName:@"YOURXIBFILE" ...? Did you overwrite the drawRect Method?

Maffo
  • 1,445
  • 1
  • 14
  • 17
  • Yes, of course, I init the cell with initWithNibName:@"YOURXIBFILE" and try to reuse it before (pattern matching the default apple sample code for a TableView project). But I didn't override drawrect method. Everything is done into IB, so I don't see why I should override it. – Oliver Jan 03 '11 at 11:18
0

yea, there is some problems to create custem cell with IB.

try write it in code, you can see a tutorial how to do this:

http://blog.webscale.co.in/?p=284

Michael H
  • 46
  • 3
0

I found a great help at : Setting background color of a table view cell on iPhone

In fact it seems that this behaviour needs coding... a very few lines, as the color set in IB is cleared at draw time. So the background color have to be set in the "willDisplayCell" tableview delegate method.

Community
  • 1
  • 1
Oliver
  • 23,072
  • 33
  • 138
  • 230