UWP - CommandBar:更多按钮是 "hidden"

UWP - CommandBar : more button is "hidden"

命令栏有问题: 我使用 template10,所以我的命令栏位于页面底部的网格中。我将 属性 ClosedDisplayMode 设置为最小。但网格默认情况下具有 Visibility=Collapsed。 当我将网格可见性切换为可见时,CommandBar 出现但更多按钮不可见,命令栏为空。但是,这里有更多按钮,因为我可以单击它。当我至少点击它一次时,按钮(“...”)的内容就会出现。 我希望这是清楚的...

编辑 2

重现问题的方法如下:

1 - 创建新的空白通用应用程序项目(无模板10)

2 - 将 MainPage.xaml 中的 XAML 代码替换为以下内容:

<Page
x:Class="BlankAppBarMoreButtonHidden.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BlankAppBarMoreButtonHidden"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>

    <Button Content="Show app bar"
            x:Name="btnShowAppBar"
            Click="btnShowAppBar_Click"/>

    <Grid Grid.Row="1"
          x:Name="appBar"
          Visibility="Collapsed">
        <CommandBar ClosedDisplayMode="Minimal">
            <CommandBar.SecondaryCommands>
                <AppBarButton Label="Commande 1"/>
                <AppBarButton Label="Commande 2"/>
            </CommandBar.SecondaryCommands>
        </CommandBar>
    </Grid>
</Grid>

3 - 在后面的代码中添加事件实现:

private void btnShowAppBar_Click(object sender, RoutedEventArgs e)
{
    appBar.Visibility = Visibility.Visible;
}

4 - 最后,运行 项目。然后按下按钮。命令栏出现,但更多按钮不可见。但是你点击它(点击它在页面右下角的预期位置),此时,内容出现了。

我根据您的代码做了一个演示,并在我的 Windows 10 PC(内部版本 10586)上重现了这个问题。

然后我在另一台装有 Windows 10 Insider Preview build 14388 的 PC 上再次测试了它。事实证明,这个问题已在 Insider Preview build 14388 上修复。

欢迎您加入 Windows Insider Program 并向我们提供可以帮助我们改进的反馈。