在XAML UWP中更改底部AppBar的高度

在XAML UWP中更改底部AppBar的高度,xaml,uwp,uwp-xaml,Xaml,Uwp,Uwp Xaml,在XAML UWP中有没有办法降低底部AppBar的高度?我有以下XAML代码: <Page.BottomAppBar> <CommandBar Height="35"> <CommandBar.SecondaryCommands> <AppBarButton Label="Share"/> <AppBarButton Label="Settings"/>

在XAML UWP中有没有办法降低底部
AppBar
的高度?我有以下XAML代码:

<Page.BottomAppBar>
    <CommandBar Height="35">
        <CommandBar.SecondaryCommands>
            <AppBarButton Label="Share"/>
            <AppBarButton Label="Settings"/>
            <AppBarButton Label="Settings"/>
            <AppBarButton Label="Settings"/>
            <AppBarButton Label="Settings"/>
            <AppBarButton Label="Settings"/>
            <AppBarButton Label="Settings"/>
        </CommandBar.SecondaryCommands>
    </CommandBar>
</Page.BottomAppBar>

问题是,当我将“高度”设置为35或低于50时,我看到底部应用程序栏上方有一个额外的空白。如果我使用黑色或蓝色作为背景色,空白区域会呈现白色


解决这个问题的最简单方法是覆盖
App.xaml.cs
文件中相应的主题资源

<Application
    x:Class="MyApp.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MyApp"
    RequestedTheme="Light">

    <Application.Resources>
        <x:Double x:Key="AppBarThemeCompactHeight">35</x:Double>
    </Application.Resources>
</Application>

命令栏
,然后我基本上只是浏览了一下,找到了与高度相关的

你找到解决方案了吗?