【发布时间】:2018-08-19 05:42:32
【问题描述】:
我做了一个什么都不做的简单应用。它只显示一个带有两个项目和一个 TextBlock 作为其内容的 NavigationView。这是代码:
<Page
x:Class="test.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:test"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<NavigationView>
<NavigationView.MenuItems>
<NavigationViewItem Content="First Item" />
<NavigationViewItem Content="Second Item" />
</NavigationView.MenuItems>
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Text="Welcome to my Page"/>
</NavigationView>
</Grid>
</Page>
为什么 TextBlock 的顶部有多余的空间?以及如何删除该空间?我知道这是可能的,因为 News 应用程序使用 NavigationView 并且没有垂直边距。这是它的截图:
【问题讨论】:
标签: xaml uwp uwp-xaml navigationview