Xamarin Forms Master Detail Page Main Page Hide Navigation Bar

狂风中的少年 提交于 2019-12-04 15:24:25

For the android implementation, add the following to your MainActivity.cs:

global::Xamarin.Forms.Forms.SetTitleBarVisibility(Xamarin.Forms.AndroidTitleBarVisibility.Never);

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);
        }
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!