6

我有一个GridHeight可以像这样增长:

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


<Grid Name="Grid" Grid.Row="0" Grid.Column="0">

</Grid>

如何上下滚动?

它是一个 Windows Phone 8 应用程序。

4

2 回答 2

7

您可以将网格构造为:

 <Grid x:Name="LayoutRoot" Background="Transparent">
       <Grid.RowDefinitions>
    <RowDefinition Height="120" />
    <RowDefinition Height="*" />
    <RowDefinition Height="3*" />
    <RowDefinition Height="5*" />
</Grid.RowDefinitions>
        <Grid> 
           ***content goes here****
        </Grid>
        <ScrollViewer VerticalScrollBarVisibility="Visible" Grid.Row="1">
            *****Put scalable content here*******
        </ScrollViewer>
        <Grid Grid.Row="0"> 
           ***content goes here****
        </Grid>
    </Grid>
于 2013-07-30T12:06:56.817 回答
1

简而言之,尽管您不会滚动网格。您将创建一个设置为屏幕尺寸或更小的网格。然后在里面放一个列表框。您可以轻松滚动列表框,因为它就是这样做的。

<Grid margin="0,0,0,0" width="480" hieght="800"> <!--These values probably need ajusted-->
  <ListBox height="800"> <!--Make sure that it is ENTIRLEY on the screen -->
    <TextBlock>Put a ton of text here and see that it scrolls</TextBlock>
    <Button>You can put anything in the list boxes</Button>
    <TextBox>Even Inputs</TextBox>
  </ListBox>
</Grid>

下面提到的另一个可行选项是滚动查看器,它也同样有效。

于 2013-07-30T12:06:56.737 回答