我一直疯了,因为我似乎无法使我的翻页自适应。我已经在网上尝试了所有代码,但无法正常工作!我在UWP应用中使用了Windows Studio模板,并且具有简单的翻转视图。我引用了此https://xamlbrewer.wordpress.com/2017/02/27/creating-a-fluid-adaptive-ui-with-variablesizedwrapgrid-and-implicit-animations/
MainPage.xaml:
<ScrollViewer VerticalScrollMode="Auto" HorizontalAlignment="Stretch" Margin="-117,66,0,0" VerticalAlignment="Stretch">
<VariableSizedWrapGrid x:Name="VariableSizedWrapGrid"
ItemHeight="1000"
ItemWidth="1392"
Orientation="Vertical"
Margin="20 20 0 0"
ScrollViewer.VerticalScrollBarVisibility="Auto">
<Grid VariableSizedWrapGrid.ColumnSpan="5"
VariableSizedWrapGrid.RowSpan="5"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Padding="0 0 20 20"
Margin="0,0,0,10"
Background="Transparent">
<FlipView x:Name="TheFlipView"
SelectionChanged="DisplayedItemChanged" Margin="-117,66,0,20" Height="1000">
<FlipView.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,0,10" >
<Image HorizontalAlignment="Center" VerticalAlignment="Top" Source="{Binding}"
Stretch="Fill" Margin="123,0,0,0" Width="1400" Height="1000"/>
</Grid>
</DataTemplate>
</FlipView.ItemTemplate>
</FlipView>
</Grid>
</VariableSizedWrapGrid>
</ScrollViewer>