Reputation: 2027
I have an UITableViewController with an iAD banner on top, under the top bar.
When banned is loaded and device is in portrait it looks good but, when there's no banners or device turn in landscape, between top bar and the first tableView's row there's an ugly empty space.
The best solution would be to move the TableView up but I can't find a way to do that; the best solution I thought was to try resizing the header of section 0 of table's but I can't go under 0; and 0 is too much!
Is there another way to move table, for example, 10 pixels up?
Upvotes: 0
Views: 97
Reputation: 4795
The table view's content inset property can be used to add a padding around its content view. If you set the top for 10 for example, there will be some padding between the table view's top, and its content's top.
Using Swift, you can set the tableView.contentInset.top
property directly. In Objective-C, you can set it like so:
self.tableView.contentInset = UIEdgeInsetsMake(10, 0, 0, 0)
Upvotes: 1