Top cell in UITableView hidden behind UINavigationBar
I have a UINavigationController controlling a stack of UIViewControllers. When I push a certain UITableViewController onto the stack, I find that the top row of its UITableView is hid开发者_StackOverflowden behind the UINavigationBar.
This problem only happens on the iPad, not the iPhone. I am using the same stack on both.
Also it only happens on one of my controller stacks. I push the same UITableViewController subclass on stacks controlled by two other UINavigationControllers, and there is no problem.
One difference in the problem case is that the UITableViewController is pushed from a UIViewController that is displaying the results table generated by a UISearchDisplayController. I don't see why this should matter (and, as I said, on the iPhone it works fine), but maybe it is significant given that a UISearchDisplayController hides the navigation bar when the UISearchBar becomes first responder.
The problem affects both the iPad device and the iPad simulator. I am using a typical UISplitViewController design, with these stacks in the left hand pane. The problem still occurs in the popover when in portrait.
I had the same problem after migrating an iphone app to a universal app. Here is what solved the problem for me. open your MainWindow.xib and dbl-click the window object. If it opens in iphone size you need to upgrade your nib. Select the document window and choose the menu item File > Create iPad Version. Save this nib with the name MainWindow-iPad.xib. Delete you original MainWindow.xib and add this one instead. After doing these steps problem disappeared and works fine for me on both iPad & iPhone.
Cheers, Harry
精彩评论