views:

66

answers:

1

I have a TableViewController and would like to have a static picture as a background, which doesn't scroll along.

The way that everyone recommends using

 [UIColor colorWithPatternImage:[UIImage imageNamed:@"backgroundPattern.png"]]

doesn't work as it will

1.) move along and 2.) put the background pattern in every cell

I know how to do it in a XIB file (namely adding another layer underneath the TableView) but how do I do it programmatically from the TableViewController?

A: 
[myTblViewController.view insertSubview:myImageView belowSubview:myTblViewController.tableView];

That should work.

If it turns out that tableView is not a direct subview of the table view controller's main view, you can try:

[[myTblViewController.tableView superView] insertSubview:myImageView belowSubview:myTblViewController.tableView];
Felixyz
UITableViewController / UIViewController doesn't have an insertSubview:belowSubview method...
Tom Irving
Woops. Fixed. Thanks.
Felixyz