首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AppBarButton.Flyout定位不良

AppBarButton.Flyout定位不良
EN

Stack Overflow用户
提问于 2014-04-27 17:39:28
回答 1查看 5.1K关注 0票数 5

A在我的Windows 8.1中有以下CommandBar (我使用的是通用模板):

代码语言:javascript
复制
    <Page.BottomAppBar>
        <CommandBar>
            <AppBarButton Label="add task" Click="GoToAddTask">
                <AppBarButton.Icon>
                    <SymbolIcon Symbol="Add" />
                </AppBarButton.Icon>
            </AppBarButton>
            <AppBarButton Label="sort by">
                <AppBarButton.Icon>
                    <SymbolIcon Symbol="Sort" />
                </AppBarButton.Icon>
                <AppBarButton.Flyout>
                    <MenuFlyout>
                        <MenuFlyoutItem Command="{Binding SortByDate}" Text="Date" />
                        <MenuFlyoutItem Text="Priority" Command="{Binding SortByPriority}" />
                        <MenuFlyoutItem Text="Name" Command="{Binding SortByName}" />
                    </MenuFlyout>
                </AppBarButton.Flyout>
            </AppBarButton>
            <AppBarButton Label="pin project" Command="{Binding PinProject}">
                <AppBarButton.Icon>
                    <SymbolIcon Symbol="Pin" />
                </AppBarButton.Icon>
            </AppBarButton>
        </CommandBar>
    </Page.BottomAppBar>

问题是,当用户单击AppBarButton“按”排序时,飞出的底部边缘似乎被卡在AppBar本身后面的屏幕底部。这是一个截图:

我检查了Windows8.1的等价物,它工作得很好(例如,here)。

我假设在AppBar本身的上方会显示反演算。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-05-07 16:19:46

我相信这是一个众所周知的问题。与其将MenuFlyout放在行中,不如在click事件上创建它:

代码语言:javascript
复制
private void AppBarButton_Click(object sender, RoutedEventArgs e)
        {
            MenuFlyout mf = (MenuFlyout)this.Resources["MyFlyout"];

            mf.Placement = FlyoutPlacementMode.Bottom;
            mf.ShowAt(this.root);
        }

看看能不能。

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23326717

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档