[英]How can i reduce the gap between button and it's flyout? C# UWP
我想在按鈕和彈出窗口之間有 0 邊距,我該怎么做?
這是我使用的代碼:
<Grid>
<Button Height="100"
Width="100"
Content="More"
Name="MoreButton">
<Button.Flyout>
<MenuFlyout x:Name="MoreButtonFlyout"
Placement="Bottom">
<MenuFlyoutItem x:Name="ReplayOn"
FontSize="12"
FontFamily="Segoe UI Regular"
HorizontalAlignment="Left"
Foreground="#252525"
Text="Item 1"
Height="32"/>
</MenuFlyout>
</Button.Flyout>
</Button>
</Grid>
我們可以通過為MenuFlyout
設置負Margin
來消除默認差距
<MenuFlyout x:Name="MoreButtonFlyout"
Placement="Bottom">
<MenuFlyout.MenuFlyoutPresenterStyle>
<Style TargetType="MenuFlyoutPresenter">
<Setter Property="Margin" Value="0,-4,0,0" />
</Style>
</MenuFlyout.MenuFlyoutPresenterStyle>
...
</MenuFlyout>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.