setStatusBarHidden stops working properly after UIDocumentInteractionController's presentPreviewAnimated

StackOverflow https://stackoverflow.com/questions/9270133

Question

So my app has the status bar set to be hidden like this in the AppDelegate. And it works as intended.

[[UIApplication sharedApplication] setStatusBarHidden:YES];

Then I use UIDocumentInteractionController's presentPreviewAnimated like this,etc.:

[self.docInteractionController presentPreviewAnimated:YES];

I observed that the status bar does show up (with battery info etc.) while in this UIDoc's preview mode. But after dismissing the preview and back to the original view, while the status bar is not there but there is a black bar instead. The size is same as the status bar.

Has anyone encountered this behavior and any remedy for this?

Was it helpful?

Solution

I am facing the same issue. Found a quick fix to this issue...set the view's frame back inside viewWillAppear... My code looks something like this...

-(void)viewWillAppear:(BOOL)animated {  
  ... //other settings
  self.view.frame = [[UIApplication sharedApplication].keyWindow bounds];
}

Hope it helps! :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top