I am using a UIPageViewController. When the in-call status bar is toggled while in this view, it adjusts fine. If the in-call status bar is open before the UIPageViewController is loaded, the page gets pushed down by 20pt and a black bar is shown in that space.
Here's a screenshot of what this looks like:
Other posts recommend using setting automaticallyAdjustsScrollViewInsets on the page controller to NO. I've already tried that and it does not work. I've also tried self.edgesForExtendedLayout = UIRectEdgeNone;
Setting the origin of the UIPageViewController frame to 0 works, but feels wrong:
CGRect frame = self.pageController.view.frame;
frame.origin.y = 0;
self.pageController.view.frame = frame;
I ended up resolving this by ensuring the right constraints were on my view controller's main view. Here is an example where I am adding a view controller's view as a subview to a root view controller and then using Masonry (https://github.com/SnapKit/Masonry) to establish constraints that will snap all the child view controller's main view's edges to the root view controller (which itself already has autoresizing masks in place from Interface Builder). This resolved my issue of the status bar leaving that black space because it was pushing this view down (rather than re-sizing):
[self.view addSubview:viewController.view];
[viewController.view mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
In your case, and I don't have your full code so I don't know for sure but something like:
[self.pageController.view mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.pageController.view.superview);
}];
.. ought to do the trick.