当ListView Horizo​​ntalAlignment = Stretch时,它不再滚动?

时间:2015-01-10 12:48:22

标签: xaml listview windows-runtime windows-phone-8.1

我正在使用一个WP WinRT应用程序,该应用程序包含一个带有ListView的页面,如果它的内容(绑定)比屏幕长,则需要滚动。现在我希望这个应用程序可以在不同的屏幕尺寸上进行扩展,但是现在滚动查看器只是落在页面上,并且不会捕捉到屏幕的底部。

XAML:

<Grid x:Name="LayoutRoot">
    <Grid.ChildrenTransitions>
        <TransitionCollection>
            <EntranceThemeTransition FromHorizontalOffset="100"/>
        </TransitionCollection>
    </Grid.ChildrenTransitions>

    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!-- Title Panel -->
    <StackPanel Grid.Row="0" Margin="19,0,0,0">
        <TextBlock Text="TITLE" Style="{ThemeResource TitleTextBlockStyle}" Margin="0,12,-0.167,0">
            <TextBlock.Foreground>
                <SolidColorBrush Color="{StaticResource LightForegroundColor}"/>
            </TextBlock.Foreground>
        </TextBlock>
        <TextBlock Text="subtitle Margin="0,-6.5,0,26.5" Style="{ThemeResource HeaderTextBlockStyle}" CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}" FontSize="48">
            <TextBlock.Foreground>
                <SolidColorBrush Color="White"/>
            </TextBlock.Foreground>
        </TextBlock>

        <TextBlock Margin="0,0,18.833,0" TextWrapping="Wrap" Text="This is a textblock with some random text." VerticalAlignment="Top" FontSize="14.667" Style="{StaticResource BaseTextBlockStyle}">
            <TextBlock.Foreground>
                <SolidColorBrush Color="{StaticResource DarkForegroundColor}"/>
            </TextBlock.Foreground>
        </TextBlock>

    </StackPanel>

        <ListView Grid.Row="1" Margin="0,10,0,0">
             <ListView.ItemTemplate>

    <DataTemplate>

            <StackPanel Margin="0,11,0,0">
                <TextBlock Style="{ThemeResource ListViewItemTextBlockStyle}" Text="Text"/>
            </StackPanel>

    </DataTemplate>

     </ListView.ItemTemplate>
</ListView>
</Grid>

0 个答案:

没有答案