本文介绍了如何禁用“滚动压缩"在滚动查看器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在模板中,我使用具有以下属性的 ScrollViewer:

In a template I'm using a ScrollViewer with the following properties:

<ScrollViewer
    VerticalScrollBarVisibility="Disabled"
    HorizontalScrollBarVisibility="Hidden"
    HorizontalSnapPointsType="MandatorySingle"
    HorizontalSnapPointsAlignment="Near"
    ZoomMode="Disabled">
    <ItemsPresenter/>
</ScrollViewer>

这基本上可以正常工作.我想要更改的唯一细节是在滚动查看器滚动到最左侧/最右侧位置时禁用滚动压缩".在这些位置,如果我触摸并拖过开头/结尾,则 ScrollViewer 的内容会略微压缩,以表明无法在该方向滚动.

This works mostly fine. The only detail I want to change is to disable "scroll compression" when the scroll viewer is scrolled to either the leftmost/rightmost positions. At these positions, if I touch and drag past the beginning/end then the contents of the ScrollViewer is compressed slightly to indicate that scrolling in that direction is not possible.

有没有办法禁用这种行为?

Is there a way to disable this behavior?

推荐答案

不,如果内容大于视口,则不能关闭过度反弹(我们称之为).如果内容完全适合 ScrollViewer 的视口,您可以设置 ScrollMode=Auto,但只有在适合时才不会过度反弹.

No you cannot turn the overbounce (what we call it) off if the content is larger than the viewport. If the content will absolutely fit within the viewport of the ScrollViewer you can set ScrollMode=Auto, but this will only not overbounce if it fits.

这篇关于如何禁用“滚动压缩"在滚动查看器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 19:09