2016-06-13 49 views
1

我在Windows上工作的通用應用程序(視窗10)Mobile.I在菜單Flyout.The菜單彈出按鈕的默認寬度查詢其餘同此代碼後不下降:在windows通用應用程序移動版中減小Menu Flyout的大小?

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

圖片:

See the Image of Menu Flyout

+0

您是否試過[this](http://stackoverflow.com/questions/32948697/tooglemenuflyout-and-menuflyoutpresenterstyle-set-width-windows-10-mobile)? –

+0

@AlexejSommer:是的。我也試過這個東西,但我想減少我的菜單飛出寬度only.I可以輕鬆地增加寬度,但我不知道如何減少寬度,所以善意建議一個更好的方式,如果你知道。 –

回答

0
<Page.BottomAppBar> 
     <AppBar x:Name="applicationbar"> 
     <AppBarButton Icon="OpenWith" Label="More.." x:Name="more_item"> 
        <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="MaxWidth" Value="70"/> 

           </Style> 
          </MenuFlyout.MenuFlyoutPresenterStyle> 
          <MenuFlyoutItem Text="Logout" FontSize="13" Padding="8,8,0,8" Click="MenuFlyoutItem_Click" > 

          </MenuFlyoutItem> 
          <MenuFlyoutItem Text="Sales" FontSize="13" Padding="8,8,0,8" Click="appbarsales_Click" /> 
         </MenuFlyout> 
        </AppBarButton.Flyout> 
       </AppBarButton> 
      </StackPanel> 

     </AppBar> 

使用MaxWidth屬性,從而縮短菜單的默認大小彈出

相關問題