更新时间:2023-01-05 18:19:37
对于android实现,请将以下内容添加到您的MainActivity.cs中:
For the android implementation, add the following to your MainActivity.cs:
global::Xamarin.Forms.Forms.SetTitleBarVisibility(Xamarin.Forms.AndroidTitleBarVisibility.Never);
对于iOS,该过程需要自定义渲染器,但这确实很基本:
For iOS, the process requires a custom renderer, but it's really basic:
public class iOSCustomMobilePageRenderer : PageRenderer
{
public override void ViewWillAppear(bool animated) {
base.ViewWillAppear(animated);
if (ViewController != null && ViewController.ParentViewController != null && ViewController.ParentViewController.NavigationController != null) {
if (ViewController.ParentViewController.NavigationController.NavigationBar != null)
ViewController.ParentViewController.NavigationController.SetNavigationBarHidden(true, false);
}
}
}