views:

146

answers:

2

Hi

I have set the background of my UITable with a custom image.

self.tableView.backgroundColor = [UIColor clearColor];
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];

The problem I'm having is the background image is scrolling and doesn't look good at the top and bottom of the screen where you see the image being joined.

Is there a way to fix the position of the background image and just have the table scroll over the top of it?

+1  A: 

Insert a UIImageView behind the UITableView. Set the UIImageView's image to background.png. Use [UIColor clearColor] as the table's background.

coob
a bit more clarity perhaps? the image still scrolls when i do this and the table isnt visible!
You've probably accidentally added the UIImageView to the UITableView's header in Interface Builder – it needs to be behind.
coob
A: 

You need to put a UIImageView beneath your table view, set the table view's background color to clear (or in IB, set the opacity property of its background at 0). Then construct your CELL views to have clear areas that your background image can be seen through. You can do that programmatically or in IB (it's easier to visualize in IB, but the code to hook it all together is a bit tricky).

Dan Ray