在通用应用

时间:2016-02-22 09:14:54

标签: c# win-universal-app windows-10-universal

我想最小化BottomAppBar的高度,这是我的xaml代码:

<Page.BottomAppBar >
    <CommandBar Background="#393185"
            Foreground="White" VerticalAlignment="Stretch" Style="{Binding Source={StaticResource Ellipsis}}" Height="40" MaxHeight="40" >
        <CommandBar.CommandBarOverflowPresenterStyle>
            <Style TargetType="CommandBarOverflowPresenter">
                <Setter Property="Background"
                    Value="#00a0e3" ></Setter>
                <Setter Property="Margin" Value="0"></Setter>
                <Setter Property="Padding" Value="0"></Setter>
                <Setter Property="BorderBrush" Value="Transparent"/>

            </Style>
        </CommandBar.CommandBarOverflowPresenterStyle>
        <CommandBar.PrimaryCommands>



            <AppBarButton Label="Cortana"
                      Icon="Microphone"
                      Foreground="White" />

        </CommandBar.PrimaryCommands>
        <CommandBar.SecondaryCommands >
            <AppBarButton Label="Info"
                      Foreground="White" Background="#00a0e3"/>
        </CommandBar.SecondaryCommands>
    </CommandBar>
</Page.BottomAppBar>
&#34; Ellepsis&#34; Style是commandBar link的默认样式 但我得到的是这个结果: enter image description here

我得到的结果是你可以在图像中看到的空间(在BottomAppbar的顶部)

我应该在此样式中更改哪个参数以最小化bottomAppBar的高度,而不是因为我得到的空白

感谢您的帮助

1 个答案:

答案 0 :(得分:1)

如果MinHeight较小(默认值为60),则可以设置属性,以便删除空白区域。

<x:Double x:Key="AppBarExpandButtonThemeHeight">48</x:Double>
<x:Double x:Key="AppBarThemeMinHeight">48</x:Double>