1
votes

By default, when a UINavigationController pushes a UIViewController, the height of view of UIViewController is set to full screen height. But when the UITableViewController is pushed, the tableview automatically adjusts its size to fit the remain space of the screen instead of setting its height to fullscreen. I wonder how the UITableViewController do this magic.

What code should I put inside the UIViewController so that the view of UIViewController behave like the tableview of the UITableViewController(view height auto fit screen)?

1

1 Answers

1
votes

Any scrollView like tableView in navigationController will have a 64px offset, but the size won't be changed. If set a property of viewController:

self.automaticallyAdjustsScrollViewInsets = NO;

Default this property is YES, If it is NO, the tableView will not have the offset and behaves like normal controller.