Is it possible to fix the position of a UITableViewController background image?
I've added the background image via the viewdidload method with the following code -
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"blurredBGW"]];
But as the table is fairly long (and also contains static cells if that matters) it scrolls (and repeats) as you scroll down the table.
you can try to add the background image as UIView and not as UIColor, try this:
self.tableView.backgroundView = [[UIImageView alloc] initWithImage:
[UIImage imageNamed:@"blurredBGW.png"]];
for swift version 3.0.try this code.it will set a fixed background to a table view controller
self.tableView.backgroundView = UIImageView(image: UIImage(named: "background.png")!)
UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg.png"]];
[tempImageView setFrame:self.tableView.frame];
self.tableView.backgroundView = tempImageView;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With