EDIT
Actually, the solution below is also not right.
I figured out it has to do with the navigationBar's translucent
property.
I was setting this property on and off throughout the cameraSection several times.
After keeping a steady value for this property, everything works fine.
OLD ANSWER - NOT WORKING !!
Ok this is VERY VERY ugly but i was able to overcome this issue by doing this:
In viewWillAppear:animated:
, register for being notified when the app reenters the foreground.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationDidBecomeActive:)
name:UIApplicationDidBecomeActiveNotification
object:nil];
The callback looks like this:
- (void)applicationDidBecomeActive:(NSNotification *)notification
{
UIEdgeInsets scrollIndicatorInset = self.collectionView.scrollIndicatorInsets;
UIEdgeInsets contentInset = self.collectionView.contentInset;
scrollIndicatorInset.top -= 44.0;
scrollIndicatorInset.bottom += 44.0;
contentInset.top -= 44.0;
contentInset.bottom += 44.0;
[self.collectionView setScrollIndicatorInsets:scrollIndicatorInset];
[self.collectionView setContentInset:contentInset];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
}
It's important to unregister when the callback was invoked once, because otherwise the offsets would be corrupted after additional re-entering.
Certainly not a nice solution, but a solution it is :/