views:

68

answers:

1

I am using a custom uitableviewcell and am trying to recreate a loose-leaf piece of paper for the background. Since each cell can grow depending on the amount of text, I need to use a pattern for the background of each cell. But I am having problems with these black lines and it's driving me mad!

I have made sure the tableview is not opaque as well as the cell.

If I set the cell backgroundView's backgroundColor = [UIColor redColor], it displays the red background with no black lines. Any ideas of what could be going on here?

Done in my view controller:

 cell.backgroundView = [[[UIView alloc] init] autorelease];

bgImage = [UIImage imageNamed:@"blogs-cell-middle.png"];

((UIView *)cell.backgroundView).backgroundColor = [UIColor colorWithPatternImage:bgImage];

http://www.freeimagehosting.net/uploads/91a1a9bfea.png

Notice the black line down the far left side, on the right side near the edge, and the double black lines on the bottom.

A: 

Ok, I figured out what was happening. For some reason, I had to set

cell.backgroundView.opaque = NO

AFTER the pattern is set. It would not work doing this beforehand.

Tom