【发布时间】:2017-06-16 09:38:58
【问题描述】:
在我的 uwp 应用程序中,我有一个 ListView,但它的高度是固定的,不可滚动> 我知道在 stackoverflow 上有很多类似的问题,但没有一个对我有帮助。
这是我的代码:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Text="{x:Bind Reply.heading}"
FontSize="20"
Grid.Row="0"
Margin="10"/>
<ListView ItemsSource="{x:Bind Reply.faq, Mode=OneWay}"
SelectionMode="None"
IsHitTestVisible="False"
Grid.Row="1">
<ListView.ItemTemplate>
<DataTemplate x:DataType="models:FaqItem">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Text="{x:Bind question, Mode=OneWay}"
FontWeight="SemiBold"
TextWrapping="WrapWholeWords"
FontSize="18"/>
<TextBlock Text="{x:Bind answer, Mode=OneWay}"
Grid.Row="1"
FontSize="16"
TextWrapping="WrapWholeWords"
Margin="0, 0, 0, 20"/>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
【问题讨论】:
-
删除这个
IsHitTestVisible="False"。