【发布时间】:2018-03-21 11:00:46
【问题描述】:
我正在开发一个 UWP 应用程序,我希望让我的 GridView 以水平模式滚动,而不是默认的垂直模式。有什么办法可以吗?
这是我的代码:
<GridView x:Name="HostListView" Grid.Row="2" Height="150" Margin="310,0,0,0"
ItemsSource="{Binding FilteredHosts}" SelectedItem="{Binding SelectedHost, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
SelectionChanged="HostListView_SelectionChanged" IsSwipeEnabled="False">
<GridView.ItemTemplate>
<DataTemplate >
<StackPanel Margin="8" Width="220">
<TextBlock Text="{Binding Name}" Style="{StaticResource TitleTextBlockStyle}"
FontSize="15" TextWrapping="NoWrap"
MaxHeight="40" Foreground="White"/>
<TextBlock Text="{Binding Designation}" Style="{StaticResource CaptionTextBlockStyle}"
TextWrapping="NoWrap" Foreground="White"/>
</StackPanel>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
【问题讨论】:
-
你想要多少行?单个或多个
标签: xaml gridview uwp horizontal-scrolling