WP8列表框不滚动



我正在开发一个WP8应用程序,并且我有滚动问题。在我的页面中,我有一个网格和两个列表框。为什么您认为?我也尝试使用scrollviewer,但结果很好。

<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="auto"/>
        <RowDefinition Height="auto"/>
    </Grid.RowDefinitions>
    <TextBlock Name="txt" TextAlignment="Center" 
               FontWeight="Bold"
               FontSize="36" Height="auto" Grid.ColumnSpan="2" Grid.Row="0"></TextBlock>
    <ListBox Name="lstCasa" Grid.Column="0" Grid.Row="1">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Vertical">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                    </Grid>
                    <TextBlock FontWeight="Bold" Text="{Binding Path=aaa}"/>
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
    <ListBox Name="lstFuori" Grid.Column="1" Grid.Row="1">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Vertical">
                    <TextBlock FontWeight="Bold" Text="{Binding Path=bbb}"/>
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</Grid>

Height="Auto"上的 CC_1没有任何东西来调用 ScrollViewer

它需要一个边界来告诉它:"嘿,您到达了允许显示的地方的尽头,任何进一步都需要滚动。"

有意义?

要修复它,您可以将RowDefinition放在"*"或该行上的固定高度或列表框上的固定高度或等于建立边界点的东西。

希望这会有所帮助。

最新更新