2015-08-29 57 views
0

我需要关于实施XAML Navigation menu sample的帮助。汉堡按钮重叠SplitView窗格

在我写的代码中,汉堡按钮与SplitView窗格重叠。

PS注意:保持应用程序简单。我使用了一个简单的ListView(而不是定制的ListView,如键盘支持示例所示)。

Demo Image

代码标题栏的后退按钮:

private void backButtonLogic() //Method related to back button 
    { 
     //Make titlebar's back button visible 
     SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = 
      AppViewBackButtonVisibility.Visible; 

     //Back button handler 
     SystemNavigationManager.GetForCurrentView().BackRequested += (s,e) => 
     { 
      bool handled = e.Handled; 

      if (AppFrame.CanGoBack && !handled) 
      { 
       handled = true; 
       AppFrame.GoBack(); 
      } 

      e.Handled = handled; 
     }; 

     //Mobile hardware back button handler 
     if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) 
      Windows.Phone.UI.Input.HardwareButtons.BackPressed += (s, e) => 
      { 
       bool handled = e.Handled; 

       if (AppFrame.CanGoBack && !handled) 
       { 
        handled = true; 
        AppFrame.GoBack(); 
       } 

       e.Handled = handled; 
      }; 
    } 
+0

如果您将ListView放置到SplitView.Pane中,它也运行良好,我注意到您在TitleBar上添加了一个后退按钮,您能否向我们展示一些代码片段? –

+0

@Franklin Chen是的,当然。我在窗格中使用了一个简单的ListView。你有关于如何防止汉堡包和面板重叠的想法吗? – Anil

+0

可以从AppShell构造函数调用此方法。 \t \t AppFrame是放置在SplitView的Content属性中的框架 – Anil

回答

0
在 “XAMLNavigation” 品尝汉堡包按钮(称为TogglePaneButton)

是SPLITVIEW元素之外声明。这就是为什么SplitView.Pane中的自定义ListView具有“0,48,0,0”的边距,因此它们不会重叠。

我假设更改ListView的顶部边距应该可以解决您的问题。 希望这有助于。