Che*_*ese 4 xaml listview horizontal-scrolling windows-runtime
主网格有下一个XAML:
<ListView Grid.Row="1" x:Name="NewsListBox">
<ListView.Background>
<SolidColorBrush Color="#FF006C67" Opacity="0.5"/>
</ListView.Background>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
Run Code Online (Sandbox Code Playgroud)
它看起来不错,它是如何需要的:
但它不会滚动内容!

好的,我添加了ScrollViewer:
<ScrollViewer Grid.Row="1" VerticalScrollMode="Disabled" ZoomMode="Disabled">
<ListView Grid.Row="1" x:Name="NewsListBox">
<ListView.Background>
<SolidColorBrush Color="#FF006C67" Opacity="0.5"/>
</ListView.Background>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)
并且它垂直堆叠所有内容:

我究竟做错了什么?
| 归档时间: |
|
| 查看次数: |
2532 次 |
| 最近记录: |