OGeek|极客世界-中国程序员成长平台

标题: ios - Xamarin.forms,删除 iOS 10 中的状态栏 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 15:37
标题: ios - Xamarin.forms,删除 iOS 10 中的状态栏

我在 AppDelegate.FinishedLaunching 中使用以下代码从我的 Xamarin 表单应用程序中删除 iOS 中的状态栏:

  UIApplication.SharedApplication.SetStatusBarHidden (true, UIStatusBarAnimation.None);

这确实移除了状态栏使用的空间,但状态栏的内容仍在呈现。

在此图像(我的应用程序处于纵向模式,亮度增强)的顶部,您可以看到时钟、电池指示器等。被绘制在我的应用程序上:

status bar drawn on top of my app

我该如何摆脱它?

这是 Forms 应用程序中的一个页面,它由一个 SKCanvasView 组成(如果相关的话)。



Best Answer-推荐答案


将这些选项添加到您的 info.plist

<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

或者

enter image description here

关于ios - Xamarin.forms,删除 iOS 10 中的状态栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45785104/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4