I would like to show an image background when my UITableView is empty. Currently I tried adding a UIImageView to my view controller that contains a table, but XCode doesn't allow it.
Is there a good way of doing it?
I would like to show an image background when my UITableView is empty. Currently I tried adding a UIImageView to my view controller that contains a table, but XCode doesn't allow it.
Is there a good way of doing it?
UITableView
has abackgroundView
property. Set this property to theUIImageView
containing your background image.You could either add an image view on top of the table view or change the background view of the table view.
In you numberOfRowsInSection method:
numberOfSections should be greater than 0