setStatusBarHidden stops working properly after UIDocumentInteractionController's presentPreviewAnimated

十年热恋 提交于 2019-12-11 11:31:39

问题


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?


回答1:


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! :)



来源:https://stackoverflow.com/questions/9270133/setstatusbarhidden-stops-working-properly-after-uidocumentinteractioncontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!