Windows phone 7 滚动查看器中的网格不工作

Windows phone 7 滚动查看器中的网格不工作,windows-phone-7,Windows Phone 7,我在scroll viewer的顶部添加了一个网格控件(我添加了大约20行,每行包含2列,每个列都有文本块作为子项,我将RowHeight设置为Auto)。它正在滚动,但没有显示网格的全部内容。原因可能是什么?问题是框架无法确定分配给控件的总体高度。尝试设置scrollviewer和/或网格的显式高度(如果可以) 更新 请把你的确切密码寄出去。(或者,至少是重新创建问题的代码。) 以下代码是我对您所描述的内容的理解,但并没有创建您正在经历的行为 <Grid x:Name="LayoutRo

我在scroll viewer的顶部添加了一个网格控件(我添加了大约20行,每行包含2列,每个列都有文本块作为子项,我将RowHeight设置为Auto)。它正在滚动,但没有显示网格的全部内容。原因可能是什么?

问题是框架无法确定分配给控件的总体高度。尝试设置scrollviewer和/或网格的显式高度(如果可以)

更新 请把你的确切密码寄出去。(或者,至少是重新创建问题的代码。)

以下代码是我对您所描述的内容的理解,但并没有创建您正在经历的行为

<Grid x:Name="LayoutRoot" Background="Transparent">
    <controls:Pivot Title="MY APPLICATION">
        <controls:PivotItem Header="first">
            <ScrollViewer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}"  Text="A1" Grid.Column="0" Grid.Row="0" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="A2" Grid.Column="1" Grid.Row="0" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="B1" Grid.Column="0" Grid.Row="1" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="B2" Grid.Column="1" Grid.Row="1" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="C1" Grid.Column="0" Grid.Row="2" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="C2" Grid.Column="1" Grid.Row="2" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="D1" Grid.Column="0" Grid.Row="3" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="D2" Grid.Column="1" Grid.Row="3" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="E1" Grid.Column="0" Grid.Row="4" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="E2" Grid.Column="1" Grid.Row="4" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="F1" Grid.Column="0" Grid.Row="5" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="F2" Grid.Column="1" Grid.Row="5" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="G1" Grid.Column="0" Grid.Row="6" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="G2" Grid.Column="1" Grid.Row="6" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="H1" Grid.Column="0" Grid.Row="7" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="H2" Grid.Column="1" Grid.Row="7" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="I1" Grid.Column="0" Grid.Row="8" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="I2" Grid.Column="1" Grid.Row="8" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="J1" Grid.Column="0" Grid.Row="9" />
                    <TextBlock Style="{StaticResource PhoneTextHugeStyle}" Text="J2" Grid.Column="1" Grid.Row="9" />
                </Grid>
            </ScrollViewer>
        </controls:PivotItem>
    </controls:Pivot>
</Grid>


我正在做以下工作。我正在网格顶部添加全景图,在堆栈面板顶部添加画布,在滚动视图上添加堆栈面板,在网格上添加滚动视图,该网格是全景图的内容。它对全景图工作正常,但使用pivot时无法正常滚动。另外,对于每个画布,我设置的高度也可能是问题所在。@gusaindpk如果您展示代码,而不是试图用简单的文字来解释它,可能会更容易,我使用的是一个网格,其中我添加了文本块,并将此网格添加到滚动视图中。以及将网格设置为轴项目。但它没有正常滚动。当我在panorama中执行相同操作时,滚动效果很好。感谢我参考了您的代码,我发现了问题,如果我将第一个基本网格行高度设置为“自动”,则pivot和scroll view无法正常工作,但panorama正常工作,因此,我已经删除了轴的行高度,现在它工作得很好,非常感谢我真的为此而努力。