How to disable “scroll compression” in ScrollViewer

混江龙づ霸主 提交于 2019-12-24 05:30:13

问题


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>

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?


回答1:


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.



来源:https://stackoverflow.com/questions/18515505/how-to-disable-scroll-compression-in-scrollviewer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!