I am using Xcode 5 with storyboard and auto layout. My views are:
In both tab views, I put a UITableView on it, and I set up the standard IB stuff. Both tab view controllers are nearly identical in code in terms of setup (they both derive from UIViewController).
For the tableview however, things are weird. The first table view has the right setting, where the cells start "below the navigation" and you can scroll it up. The second table view starts with the cells "under the navigation" - it seems like the insets are wrong.
But why would it be wrong for just the second tab view, and not the first? I did not do anything funky with either, and I've pored over the code multiple times to be sure that both tableview controllers are nearly identical (except in the cell contents).
(on the second image, notice the bit of green under the "Carrier" status bar).
Trying toggling the "Adjust Scroll View Insets" in the view controller's Attributes inspector. You want it ticked.
I faced this same problem once.
Try toggling the "Under Top Bars" in the view controller's Attributes inspector.
This worked for me. Hope it does for you too. Thanks.
Sadly it seems that if you have the TabBarController as the RootViewController for the NavigationController ( Navigation -> Tab -> Table View C, Table View C ) this will happen. The fix may be to give each table view their own navigation controller ( Tab -> (Nav -> Table View C), (Nav -> Table View C) While that may not work with all desired designs, it worked in my situation (which was the same as yours)
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