在我的页面中,我有底部的命令栏,如果这个命令栏是打开的,并且用户单击SplitView菜单,那么命令栏就会覆盖菜单。
下面是splitview的xaml页面:
<SplitView x:Name="NavigationSplitView"
DisplayMode="CompactOverlay"
IsPaneOpen="True"
CompactPaneLength="{StaticResource ShellCompactPaneSize}"
OpenPaneLength="300"
PaneBackground="{ThemeResource SplitViewBackgroundBrush}"
>
<!--//App root frame where all content data will be loaded-->
<Frame x:Name="rootFrame" />
<SplitView.Pane>
...
</SplitView.Pane></SplitView>下面是在内容页上设置命令栏的方法,该命令栏加载到splitview rootFrame中:
<Page.BottomAppBar>
<CommandBar x:Name="AppCommandBar"
Background="Transparent">
<CommandBar.PrimaryCommands>
<AppBarButton Name="Save"
Icon="Save"
Label="Save"></AppBarButton>
<AppBarButton Name="Clear"
Icon="ClearSelection"
Label="Clear"></AppBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>
</Page.BottomAppBar>请检查下面的屏幕截图,我有一个绿色背景的Splitview,你可以看到命令栏是重叠的。
SplitView问题截图
下面是演示应用程序onedrive 链接
发布于 2016-04-26 10:46:47
您的内容页面应该如下所示
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock FontSize="36"
Text="Content Page"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Black"></TextBlock>
<CommandBar x:Name="AppCommandBar" VerticalAlignment="Bottom">
<CommandBar.PrimaryCommands>
<AppBarButton Name="Save"
Icon="Save"
Label="Save"></AppBarButton>
<AppBarButton Name="Clear"
Icon="ClearSelection"
Label="Clear"></AppBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>
</Grid>发布于 2016-04-26 09:23:23
删除<Page.BottomAppBar>,将<CommandBar>....</CommandBar>移动到内容页的内容中(在根框架中)。
https://stackoverflow.com/questions/36860450
复制相似问题