Scrollviewer 无法滚动 的原因

来源:互联网 发布:手机网络浏览器 编辑:程序博客网 时间:2024/06/05 18:15

Grid里的width或高都不应小于scrollviewer 里的。

倘若Scrollviewer里有listbox,可重写listbox里的数据,取消滚动轴。以下例子来自网络:

<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
     <ListBox
     <ListBox.Template>
        <ControlTemplate TargetType="ItemsControl">
            <Border>
                <ItemsPresenter />
            </Border>
        </ControlTemplate>
     </ListBox.Template>
     <ListBox.ItemsPanel>
         <ItemsPanelTemplate>
             <VirtualizingStackPanel />
         </ItemsPanelTemplate>
     </ListBox.ItemsPanel>
    <\ListBox>
<\ScrollViewer>

0 0
原创粉丝点击