【发布时间】:2016-06-13 07:33:48
【问题描述】:
我正在 Mobile 中使用 windows 通用应用程序(Windows 10)。我在菜单弹出中进行了查询。菜单弹出的默认宽度保持不变,在此代码之后不会减少:
<AppBarButton Icon="OpenWith" Label="More.." Width="55">
<AppBarButton.Flyout>
<MenuFlyout>
<MenuFlyout.MenuFlyoutPresenterStyle>
<Style TargetType="MenuFlyoutPresenter">
<Setter Property="Margin" Value="0,-31,0,0" />
<Setter Property="Background" Value="#FFE45427" />
<Setter Property="FontSize" Value="12" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="MinWidth" Value="70" />
</Style>
</MenuFlyout.MenuFlyoutPresenterStyle>
<MenuFlyoutItem Text="Logout" FontSize="13" Padding="8,8,0,8" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="Sales" FontSize="13" Padding="8,8,0,8" Click="appbarsales_Click" />
</MenuFlyout>
</AppBarButton.Flyout>
</AppBarButton>
图片:
【问题讨论】:
-
你试过this吗?
-
@AlexejSommer:是的。我也尝试过这个东西,但我只想减少菜单弹出宽度。我可以轻松增加宽度,但我不知道如何减少宽度,所以如果你知道,请提出更好的方法。
标签: wpf xaml win-universal-app windows-10