【发布时间】:2017-07-18 14:44:53
【问题描述】:
我正在尝试在我的 UWP 应用底部使用 CommandBar,但我似乎无法摆脱底部的这个空白。
很难看到,但它位于 CommandBar 和窗口底部边框之间。我尝试了各种VerticalAlignment 配置,但似乎没有任何效果。我创建了一个用户控件
<UserControl
x:Class="PivotalTrackerUWP.Controls.NavigationControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:PivotalTrackerUWP.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:svg="using:Mntone.SvgForXaml.UI.Xaml"
mc:Ignorable="d"
d:DesignHeight="50"
d:DesignWidth="400">
<Grid Height="50" VerticalAlignment="Bottom">
<StackPanel VerticalAlignment="Bottom">
<CommandBar Height="50">
<CommandBar.SecondaryCommands>
<AppBarButton Label="Preferences"/>
<AppBarSeparator/>
<AppBarButton Label="My Account"/>
<AppBarButton Label="Logout" Click="LogoutButton_Click"/>
</CommandBar.SecondaryCommands>
</CommandBar>
</StackPanel>
</Grid>
</UserControl>
然后我在底部主网格内的其他 XAML 页面中使用此控件。当在此 UserControl 的设计器中时,底部仍然存在该间隙,所以我认为它与控件中的 XAML 有关。
【问题讨论】: