Hi!
With iOS 15 beta some custom UITableViewControllers has decided to add a gap between the navigation bar and the table view while others don't. They are created the same and added the same with the showViewController:sender: method.
I found a workaround by removing
[super viewWillAppear:animated];
in the viewWillAppear: method but I don't find this to be a good solution.
Does anyone have this issue as well or know a solution?
Best regards,
dumle
I find a way to solve the issue and wrote an article about this. https://medium.com/@GalvinLi/fix-the-table-header-gap-in-ios-15-197debb92608
In short way:
Just set a tableHeaderView
before table loaded.
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)];
}
or change it globally
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[UITableView appearance].tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)];
return YES;
}