mrd
mrd

Reputation: 4699

AutoLayout and UITableView: how to adjust for Tabbar?

I have an UITableViewController which is embedded in a TabbarController which in turn is embedded in a UINavigationController. Now, the scrollview of the tableview scrolls the first 2 rows under the navigation bar on the top. See screenshot: enter image description here

How can I adjust that?

Upvotes: 0

Views: 676

Answers (2)

P. Sami
P. Sami

Reputation: 2207

Try navigationBar.translucent = NO; in your viewDidLoad.

This happens due to the transparency feature that they introduced on iOS 7.

There's also another way: Unchecking the "Under Top Bars" in the storyboard will also fix the issue (select the view controller)

Upvotes: 0

mrd
mrd

Reputation: 4699

self.tableView.contentInset = UIEdgeInsetsMake(64.0,0.0,44.0,0.0);

This did the trick for me (in viewDidLoad)

Upvotes: 1

Related Questions