Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make TableView background not scrollable

today I've an other problem: I add a background image to a table view and I like that stay stationary when the cells scroll. I found this

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

here iPhone Fixed-Position UITableView Background.

but I'm not able to "translate" from Objective-c to Swift... so can anyone help me?

like image 510
Fabio Cenni Avatar asked Jan 20 '26 16:01

Fabio Cenni


1 Answers

You could 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
like image 67
Epic Defeater Avatar answered Jan 23 '26 13:01

Epic Defeater



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!