I'm presenting CNContactPickerViewController
(strongly referenced ivar):
contactsViewController = [[CNContactPickerViewController alloc] init];
contactsViewController.delegate = self;
[self presentViewController:contactsViewController animated:YES completion:nil];
However, here is the result:
After encountering the problem I've tried changing the appearance of search bar (not sure what I should set, just trying): [[UISearchBar appearanceWhenContainedInInstancesOfClasses:@[[CNContactPickerViewController class]]] setBarTintColor:[UIColor redColor]];
but it didn't do anything.
Why would this happen and how can I fix it?
UPDATE: I've tried various combinations of the following on the contacts view controller:
automaticallyAdjustsScrollViewInsets
definesPresentationContext
edgesForExtendedLayout
modalPresentationStyle
modalPresentationCapturesStatusBarAppearance
However, nothing changes at all. They all yield the same result.
I've encountered the same problem on some other remove view controllers too.
I've had some code that set appearances using proxies on app startup, which looked suspicious. I've disabled the code that set appearance proxies on app startup and the problem went away. After investigating, I've found out the culprit:
[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
I was using this for making the navigation bar background completely transparent at some places, though it was something leftover from old designs and weren't needed. I've removed the line and the problem went away.