我想在 XAML 中做這些事情。=> https://docs.microsoft.com/en-us/windows/apps/design/layout/images/rsp-design/rspd-revealhide.gif
我試著自己做,但我有點卡住了。
感謝幫助!
uj5u.com熱心網友回復:
這與您提供的 gif 接近。
<StackPanel>
<StackPanel.Resources>
<Style TargetType="AppBarElementContainer">
<Setter Property="Margin" Value="10,0,10,0" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style TargetType="Border">
<Setter Property="Background" Value="DimGray" />
<Setter Property="Width" Value="50" />
<Setter Property="Height" Value="50" />
</Style>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="10" />
<Setter Property="FontSize" Value="30" />
</Style>
</StackPanel.Resources>
<CommandBar
Margin="10"
HorizontalAlignment="Left"
Background="Gray"
OverflowButtonVisibility="Visible">
<AppBarElementContainer>
<Border>
<TextBlock Text="A" />
</Border>
</AppBarElementContainer>
<AppBarElementContainer>
<Border>
<TextBlock Text="B" />
</Border>
</AppBarElementContainer>
<AppBarElementContainer>
<Border>
<TextBlock Text="C" />
</Border>
</AppBarElementContainer>
<AppBarElementContainer>
<Border>
<TextBlock Text="D" />
</Border>
</AppBarElementContainer>
<AppBarElementContainer>
<Border>
<TextBlock Text="E" />
</Border>
</AppBarElementContainer>
<AppBarElementContainer>
<Border>
<TextBlock Text="F" />
</Border>
</AppBarElementContainer>
<AppBarElementContainer>
<Border>
<TextBlock Text="G" />
</Border>
</AppBarElementContainer>
</CommandBar>
</StackPanel>
您可能需要調整CommandBar
's Height
。
應用程式.xaml
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
<x:Double x:Key="AppBarThemeCompactHeight">100</x:Double>
</ResourceDictionary>
</Application.Resources>
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/508532.html