问题
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