WP7上带有滚动查看器的自动回弹

本文关键字:滚动 WP7 | 更新日期: 2023-09-27 18:28:41

大家好,我的滚动有问题,它总是回弹,有人可以帮助我找到错误:)谢谢!                                                                                                     已更新,仍然无法正常工作

<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Height="954" Background="White">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" MinHeight="45"/>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <!--TitlePanel contains the name of the application and page title-->
    <!--ContentPanel - place additional content here-->
    <!--TitlePanel contains the name of the application and page title-->
    <StackPanel x:Name="TitlePanel" Margin="12,17,0,28" />
    <!--ContentPanel - place additional content here-->
    <ScrollViewer HorizontalAlignment="Left" x:Name="scrollViewer1" VerticalAlignment="Stretch" Width="465" Margin="-9,0,0,0">
        <Grid x:Name="ContentPanel" Margin="12,8,12,-226" Grid.RowSpan="2" >
            <Grid Height="986" Margin="6,2,-37,730">
                <Grid.RowDefinitions>
                    <RowDefinition Height="832*" />
                    <RowDefinition Height="154*" />
                </Grid.RowDefinitions>
                <StackPanel x:Name="stackPanel1" Margin="16,116,227,0" d:LayoutOverrides="HorizontalAlignment" Grid.RowSpan="2"></StackPanel>
                <StackPanel x:Name="stackPanel2" Margin="0,173,9,-11" HorizontalAlignment="Right" Width="207" Grid.RowSpan="2"></StackPanel>
                <Rectangle Height="50" HorizontalAlignment="Left" Margin="-26,33,0,0" Name="rectangle1" Stroke="Black" StrokeThickness="1" VerticalAlignment="Top" Width="359" Fill="#FFFF57CB" />
                <TextBlock Height="51" HorizontalAlignment="Left" Margin="24,33,0,0" Name="textBlock1" Text="Case Taking" VerticalAlignment="Top" Width="311" FontWeight="SemiBold" FontSize="32" />
            </Grid>
        </Grid>
    </ScrollViewer>
</Grid>

WP7上带有滚动查看器的自动回弹

删除高度="..."并将其更改为垂直对齐="拉伸">

ScrollViewer将滚动其内容。您正在做的是给ScrollViewer一个大尺寸(带有高度(,因此它认为它不需要滚动。