我正在创建一种簿记员,并希望每个部分都可以水平滚动(有点像ibooks)。我试图用Gridview
包裹我的ScrollViewer
,但这搞砸了。感谢帮助!这是我的代码段:
<ScrollViewer Margin="10,0,0,0">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="5,10,5,5">
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<TextBlock Text="Romances" FontSize="18"/>
<GridView Name="JuvenileBooks" Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" >
<GridView.ItemTemplate>
<DataTemplate x:DataType="data:BookModel">
<local:BookshelvesDataTemplate/>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
</ScrollViewer>
答案 0 :(得分:2)
我认为这是你要找的东西
<GridView >
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
</GridView>