我想改变BottomAppBar的高度,就像NavigationBar的Hight一样,这是我的尝试:
<Page.BottomAppBar>
<CommandBar Background="#393185"
Foreground="White" VerticalAlignment="Stretch" Style="{Binding Source={StaticResource Ellipsis}}" Height="40" MinHeight="40">
<CommandBar.PrimaryCommands>
<AppBarButton Label="Cortana"
Icon="Microphone"
Foreground="White"
MinHeight="40" Height="40"/>
</CommandBar.PrimaryCommands>
</CommandBar>
</Page.BottomAppBar>
推荐这篇文章:CommandBar style
这是我得到的结果:
正如您所看到的,我在Grid和BottomAppBar之间获得了一个空间 所以请问有什么办法可以删除这个保证金吗? 谢谢你的帮助
更新: 我在CommandBarOverflowPresenter中尝试过这样的:Styles.xaml
<CommandBarOverflowPresenter x:Name="SecondaryItemsControl"
Style="{TemplateBinding CommandBarOverflowPresenterStyle}"
IsEnabled="False"
IsTabStop="False">
<CommandBarOverflowPresenter.RenderTransform>
<TranslateTransform x:Name="OverflowContentTransform"/>
</CommandBarOverflowPresenter.RenderTransform>
<CommandBarOverflowPresenter.ItemContainerStyle>
<Style TargetType="FrameworkElement">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Width" Value="NaN"/>
<Setter Property="Margin" Value="0,-10,0,0"/>
</Style>
</CommandBarOverflowPresenter.ItemContainerStyle>
</CommandBarOverflowPresenter>
我已将高度和min MinHeight设置为40,如下所示:Page1.xaml
<CommandBar Background="#393185"
Foreground="White"Height="40" MinHeight="40">
<CommandBar.CommandBarOverflowPresenterStyle>
<Style TargetType="CommandBarOverflowPresenter">
<Setter Property="Background"
Value="#00a0e3" ></Setter>
<Setter Property="Margin" Value="0,-10,0,0"></Setter>
</Style>
</CommandBar.CommandBarOverflowPresenterStyle>
</CommandBar>
但我总是遇到同样的问题,在我的代码中想念我:( 再次感谢您的帮助