UIDocumentInteractionController 的presentPreviewAnimated 之后 setStatusBarHidden 停止正常工作

发布于 2025-01-05 04:55:42 字数 422 浏览 2 评论 0原文

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

[[UIApplication sharedApplication] setStatusBarHidden:YES];

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

[self.docInteractionController presentPreviewAnimated:YES];

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

有没有人遇到过这种行为以及对此有什么补救措施?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

絕版丫頭 2025-01-12 04:55:42

我面临着同样的问题。找到了此问题的快速修复...将视图的框架设置回 viewWillAppear...我的代码看起来像这样...

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

希望它有帮助! :)

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文