I’ve got an app that worked OK in iOS 4 but is having several problems in iOS 5 because of the tab bar related changes. In a couple of cases I have a UINavigationController with no buttons and a UITableView as the root view. The UINavigationBar background header image is fairly tall, and as a result the top row of the table is getting hidden. I need to somehow move the root view controller origin down about 40 pixels.
I’ve tried setting the nav bar height — this just hides more of the table as I increase its height.
I’ve tried setting the origin of the root view controller’s view — this seems to be ignored.
I’m kind of running out of ideas.
Anyone know how to push the origin of the table view down?
Well, after scanning through all the superclass methods about 6 times I finally realized that a UITableViewController has a UITableView which is a subclass of UIScrollView, and UIScrollView has the
insetproperty. Setting the top inset (which is, oddly, in points) provides padding above the start of the table.The scroll view still wants to display the table scrolled up with the first row hidden behind the header, but doing
scrollRectToVisible:fixes that.