[英]How to remove top bar from Xamarin.Forms (iOS)?
您可以在 LoadApplication (new App ());
之后,在FinishedLaunching
方法内的AppDelegate.cs
上添加此代码LoadApplication (new App ());
在iOS项目上:
UIApplication.SharedApplication.StatusBarHidden = true;
还将其添加到您的info.plist
:
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
如果您要以编程方式隐藏每个页面。 您必须使用UIViewController为每个“表单页面”创建自定义渲染器。
在UIViewController中,您可以重写如下方法
public partial class CustomViewController : UIViewController
{
public override bool PrefersStatusBarHidden()
{
return true;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.