Windows phone 8 ScrollViewer在Windows Phone 8中不滚动

Windows phone 8 ScrollViewer在Windows Phone 8中不滚动,windows-phone-8,scrollviewer,Windows Phone 8,Scrollviewer,看来xaml不是我喜欢的。标题说明了一切 <phone:Panorama Title="MSFT Insider" Background="#FFD8D8D8" Foreground="Black" Style="{StaticResource PanoramaStyle1}"> <!--Elemento Panorama uno--> <phone:PanoramaItem Header="Portada" Fon

看来xaml不是我喜欢的。标题说明了一切

<phone:Panorama Title="MSFT Insider" Background="#FFD8D8D8" Foreground="Black" Style="{StaticResource PanoramaStyle1}">

            <!--Elemento Panorama uno-->
            <phone:PanoramaItem Header="Portada" FontSize="20">
                <StackPanel HorizontalAlignment="Left" Width="416">
                    <ScrollViewer Height="Auto" Width="416" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalScrollBarVisibility="Auto">

                        <ListBox x:Name="frontpost_list" Width="416" Height="Auto" Margin="0,0,0,0" VerticalAlignment="Top" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                    <StackPanel HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top" Width="416">
                                        <Grid Width="415" Height="240">
                                            <Image Source="Assets/PanoramaBackground.png" Stretch="UniformToFill" Height="240" Width="415"/>
                                            <TextBlock VerticalAlignment="Bottom" FontSize="29.333" FontWeight="Bold" Margin="10,0,10,20" UseLayoutRounding="True" Padding="0" TextWrapping="Wrap" TextTrimming="WordEllipsis" Text="{Binding Title}" FontFamily="Arial" CharacterSpacing="1" Foreground="Black"/>
                                        </Grid>
                                    </StackPanel>
                                </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                    </ScrollViewer>
                </StackPanel>
                <!--Lista de una línea con ajuste automático de texto-->
            </phone:PanoramaItem>

屏幕会自动返回到以前的位置,滚动未完成。它只是像一根橡皮筋一样来回移动

ScrollViewer没有滚动,ScrollViewer中的元素比包含ScrollViewer的StackPanel中的元素长。当我尝试滚动时,它会反弹


谢谢。

编辑了我的答案。在VS中尝试此操作并发现错误。
ListBox
根本不需要
ScrollViewer
,而且您有
Height=“Auto”
。这意味着它会将列表框扩展到所需的高度,从而禁用它的可滚动性。而且在DataTemplate中不需要StackPanel和Grid

<phone:PanoramaItem Header="Portada" FontSize="20">
            <StackPanel HorizontalAlignment="Left" Width="416">
                    <ListBox x:Name="frontpost_list" Width="416" Height="400" Margin="0,0,0,0"> //Notice the height
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top" Width="416">
                                    <Image Source="Assets/PanoramaBackground.png" Stretch="UniformToFill" Height="240" Width="415"/>
                                    <TextBlock VerticalAlignment="Bottom" FontSize="29.333" FontWeight="Bold" Margin="10,0,10,20" UseLayoutRounding="True" Padding="0" TextWrapping="Wrap" TextTrimming="WordEllipsis" Text="{Binding Title}" FontFamily="Arial" CharacterSpacing="1" Foreground="Black"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
            </StackPanel>
            <!--Lista de una línea con ajuste automático de texto-->
        </phone:PanoramaItem>

//注意高度

您要滚动的元素是什么?列表框“frontpost\u列表”