[英]uwp fixed position grid
一个父网格下有三个子网格。
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Name="grid1"> </Grid>
<Grid Grid.Row="1" Name="grid2"> </Grid>
<Grid Grid.Row="2" Name="grid3"> </Grid>
</Grid>
如果grid2有更多数据,则所有三个网格都在滚动。 我希望grid1和grid3的位置应该固定,只有中间网格应该滚动
如果可以,请为grid1和grid3使用固定的大小值
您可以使用滚动查看器控件
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" VerticalAlignment="Top" Name="grid1"> </Grid>
<Grid Grid.Row="1" Name="grid2">
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
//Content Here
</ScrollViewer>
</Grid>
<Grid Grid.Row="2" VerticalAlignment="Bottom" Name="grid3"> </Grid>
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Name="grid1" Margin="10">
<TextBlock Text="Some Data"/>
</Grid>
<Grid Grid.Row="1" Name="grid2" Margin="10">
<ScrollViewer VerticalScrollMode="Auto">
<StackPanel>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
<TextBlock Text="Some Data "/>
</StackPanel>
</ScrollViewer>
</Grid>
<Grid Grid.Row="2" Name="grid3" Margin="10">
<TextBlock Text="Some Data"/>
</Grid>
</Grid>
*您需要将水平/垂直滚动模式设置为自动/启用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.