Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

markredson

macrumors newbie
Original poster
Feb 27, 2009
3
0
I am trying to give a UITableView a background image. I know this can be done by making the tableView's background to clear and put an image behind it. I tried:

Code:
	bg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
	[bg setImage:[UIImage imageNamed:@"main_bg.png"]];
	[self.view addSubview:bg];

But the TableView is a child in a tableview controller, so the bg is being added above the tableview.

Suggestions?
 
I think I have the same issue with my list view.

The MainWindow.xib is loaded and obviously sits over the RootViewController when it loads through the main window, obscuring the background. I must have tried everything to get the custom background to show through, but it doesn't seem to work.

I have built the whole thing in Interface Builder, which makes it very visual, and it looks great on the RootViewController.xib, but when I run it in simulator, I either get the standard white background, or a black one if I change the opacity of the MainWindow to 0.

I am currently trying to build it in the mainWindow, as that seems to be the only way. Doesn't answer the problem if I need a child controller. Or am I missing a trick?:confused:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.