Make TableView background non-scrollable

I have a different problem today: I am adding a background image to the table view and I like to stay stationary as the cells scroll. I found this

self.tableView.backgroundView = [[UIImageView alloc] initWithImage:
             [UIImage imageNamed:@"background.png"]];


here's an iPhone with a fixed position UITableView Background .

but i can't "translate" from Objective-c to Swift ... so can someone help me?


source to share

1 answer

You can try something like this.

var view = UIImageView(frame: /*whatever you want your frame to be*/)

view.image = //whatever you want your image to be

tableView.backgroundView = view




All Articles