在UIDocumentInteractionController的presentPreviewAnimated之后,setStatusBarHidden停止正常工作 [英] setStatusBarHidden stops working properly after UIDocumentInteractionController's presentPreviewAnimated

查看:209
本文介绍了在UIDocumentInteractionController的presentPreviewAnimated之后,setStatusBarHidden停止正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我的应用程序的状态栏设置为在AppDelegate中隐藏。它按预期工作。

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];

然后我像这样使用UIDocumentInteractionController的presentPreviewAnimated等:

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

[self.docInteractionController presentPreviewAnimated:YES];

在此UIDoc的预览中,我发现状态栏确实显示(带有电池信息等)模式。但在解除预览并返回原始视图后,虽然状态栏不存在,但是有一个黑条。大小与状态栏相同。

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?

推荐答案

我面临同样的问题。找到了这个问题的快速解决方案...将视图的框架设置回viewWillAppear ...我的代码看起来像这样...

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];
}

希望有所帮助! :)

这篇关于在UIDocumentInteractionController的presentPreviewAnimated之后,setStatusBarHidden停止正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆