我在处理不同的屏幕尺寸时遇到了问题,问题是文本!
我有下一部分:
这是显示 1024x768
这是显示 2560x1440
在 Stack 上有人给我提示 ViewBox 可以帮助我解决这个问题,好的,我试试这个:
但这是什么?
当文本不适合时,它会缩小——这很好,但是如何告诉其他(相同级别的元素)采用相同的缩小级别?
换句话说,我希望所有文本大小相同。
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Image HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Source="arrow_step_1.png" Stretch="Fill" />
<Image Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Source="arrow_step_1.png" Stretch="Fill"/>
<Image Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Source="arrow_step_1.png" Stretch="Fill"/>
<Image Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Source="arrow_step_1.png" Stretch="Fill"/>
<Viewbox>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="One" FontSize="20"/>
</Viewbox>
<Viewbox Grid.Column="1">
<TextBlock Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Two" FontSize="20"/>
</Viewbox>
<Viewbox Grid.Column="2">
<TextBlock Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Threeeeeeeeeee" FontSize="20"/>
</Viewbox>
<Viewbox Grid.Column="3">
<TextBlock Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Four" FontSize="20"/>
</Viewbox>
</Grid>