我在想什么是在Windows 10/Windows 8(.1)应用程序中正确缩放视图的最佳方法。如何正确缩放视图
- ViewBox?
- VisualStateManager?
- 其他?
我的图片已经由.scale-xxx.png
这里是我的xaml代码:
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="2*" />
<RowDefinition Height="6*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<TextBlock Text="{x:Bind ViewModel.Player, Mode=OneWay}" Margin="20,0,0,0" VerticalAlignment="Center" />
<Image Grid.Row="0" Source="ms-appx:///Resources/Title/title-app.png" VerticalAlignment="Center" Stretch="None" HorizontalAlignment="Center" />
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,5,25,5">
<Image Source="ms-appx:///Resources/Rating/star-full.png" Stretch="None" />
<TextBlock FontWeight="Bold" Margin="5,5,0,0" Text="{x:Bind ViewModel.Stars, Mode=OneWay}" FontSize="30" VerticalAlignment="Center" />
</StackPanel>
'AdaptiveTrigger'在Windows 8.1中不可用(在问题中提到过)。 – WiredPrairie
是的,你必须选择你使用的操作系统。我正在研究Windows 10的UWP,因为我更喜欢'AdaptiveTrigger'。 – blueeyes
如果你需要Windows 10+,这是一个很好的解决方案。 – WiredPrairie