Jon*_*nas 5 c# xaml microsoft-metro windows-8 windows-runtime
我想有一个接口与3个组件紧挨着另一个.第一个是ListView,另外两个是Grids.
由于组件将在右侧溢出,我想将它们放在ScrollViewer中.我没有成功.我试着做一个非常简单的例子来试试,但即便是这个例子也失败了.
<ScrollViewer Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="400">
<StackPanel Width="1200" Height="400" Orientation="Horizontal">
<Border Background="AntiqueWhite" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
<Border Background="Blue" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
<Border Background="LimeGreen" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
</StackPanel>
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)
如您所见,ScrollViewer位于网格内部.我错过了什么?
尝试在滚动查看器上设置这些属性: -
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" ZoomMode="Disabled" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="400">
<StackPanel Width="1200" Height="400" Orientation="Horizontal">
<Border Background="AntiqueWhite" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
<Border Background="Blue" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
<Border Background="LimeGreen" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
</StackPanel>
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)
这通常对我有用!
| 归档时间: |
|
| 查看次数: |
5447 次 |
| 最近记录: |