Xamarin在MasterDetailPage

时间:2017-06-14 14:28:51

标签: c# xamarin xamarin.forms master-detail hamburger-menu

有没有办法将MasterDetailPage放入另一个MasterDetailPage的Detail中,并在Detail视图的Master NavigationBar中显示“Hamburger”-Button?

我的方法:

Current.MainPage = new MasterDetailPage
  {
    MasterBehavior = MasterBehavior.Popover,
    Master = new ShellPage
    {
      //ParentPage = this,
      Title = "Einstiegspunkte",
      Icon = Device.RuntimePlatform == Device.iOS ? "Hamburger.png" : null // Device.OnPlatform<string>("Icon-Small.png", null, null)
    },

    Detail = Device.Idiom == TargetIdiom.Phone ? new NavigationPage(cp)
    {
      Title = "ListPage",
      //Icon = Device.OnPlatform<string>("tab_about.png", null, null)
    } : new NavigationPage(new MasterDetailPage()
    {
      Master = new NavigationPage(new ListPage(ep))
      {
        Title = "ListPage"
      },
      Detail = new NavigationPage(new ContentPage
      {
        Content = new Label
        {
          Text = "Hallo erstmal"
        }
      })
    })

  };

这导致顶部有两个NavigationBars。第一部分展示了“汉堡”-Button。我也试图隐藏第一个NavigationBar,什么效果很好,但后来我看不到“汉堡”-Button。 有人试过吗?

0 个答案:

没有答案