Winphone 中的ScrollViewer 总是滚动不到最低的值

2023-05-24,,

对于ScrollViewer中里面添加的封装的可展开收缩效果的控件,总是在展开和收缩时,不能滚动选择最下面的值或者展开后滚动不到后面的值,

检查多遍发现,原来是ScrollViewer中前面包了StackPanel导致的,所以若布局时不建议用StackPanel

建议用Grid。如:

<Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"></RowDefinition>
                        <RowDefinition Height="70"></RowDefinition>
                    </Grid.RowDefinitions>
                        <ScrollViewer Name="sv_Cinema" Margin="0,10" Grid.Row="0" >
                            <StackPanel Name="sp_Cinema"></StackPanel>
    
                    </ScrollViewer>
                        <Button Grid.Row="1" Width="144" Content="确定"
                                HorizontalAlignment="Center"  >
                            <Button.Background>
                                <ImageBrush Stretch="Uniform" ImageSource="/p_w_picpaths/_0036--小图.png"/>
                            </Button.Background>
                        </Button>
</Grid>

《Winphone 中的ScrollViewer 总是滚动不到最低的值.doc》

下载本文的Word格式文档,以方便收藏与打印。