My app has the UITableView which have variable quantity of cells inside.
How can I add empty (blank) space with certain height under the UITableView? Or in the very end of UITableView? So that after the very last cell there will be more blank space.
Set the content inset on your table view:
var insets: UIEdgeInsets = tableView.contentInset
insets.bottom = 100
tableView.contentInset = insets
or, simply:
tableView.contentInset.bottom = 100
That will leave some blank space under the table view after you scroll to the last cell.
Add the following, likely in viewDidLoad:
tableView.contentInset.bottom = 100Really that's all there is to it.
override func viewDidLoad() {
super.viewDidLoad()
tableView.contentInset.bottom = 100
}
You can use tableView Footer for that
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 100)];
[self.tableView setTableFooterView:view];
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