UITableView Background Image

Discussion in 'iOS Programming' started by markredson, Mar 24, 2009.

  1. markredson macrumors newbie

    Joined:
    Feb 27, 2009
    #1
    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?
     
  2. boyplunder macrumors regular

    boyplunder

    Joined:
    Sep 8, 2008
    Location:
    UK
    #2
    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:
     

Share This Page