簡體   English   中英

ScrollViewer不會滾動

[英]The ScrollViewer does not scroll

我想有一個接口與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>

如您所見,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>

這通常對我有用!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM