minimize the Height of the BottomAppBar in a universal App

你离开我真会死。 提交于 2019-12-02 14:10:03

问题


I want to minimize the Height of the BottomAppBar this is my xaml code:

<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>

the "Ellepsis" Style is the default Style of the commandBar link but what I get is this result:

I get as a result the space that you can see in the image(in the top of the BottomAppbar)

which parameter should I change in this Style to minimise the Height of bottomAppBar whithout the white space that I get as a result

thanks for help


回答1:


You can set the properties if the MinHeight to be smaller (default is 60) so the white space is removed.

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


来源:https://stackoverflow.com/questions/35549711/minimize-the-height-of-the-bottomappbar-in-a-universal-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!