The scrollviewer “locks” when scrolling vertically or horizontally

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 09:45:23

问题


If I start the scrolling vertically or horizontically the scroller "locks", such that you can only scroll horizontically or vertically, untill you let go. If I however start of by scrolling diagonally, there is no problem, in thhese cases I can manouvre the scrollviewer how i want. How do I make sure that the scrollViewer doesn't "lock" if I start of scrolling vertically or horizontically. Here is my scrollViewer:

<StackPanel>
    <TextBlock x:Name="MainPageTitle" Text="{Binding title}" Height="89"/>

    <ScrollViewer Width="768" Height="380" HorizontalScrollBarVisibility="Hidden">
        <Map/>
    </ScrollViewer>

    <TextBlock x:Name="LEgE" Text="HEJHEJEHEJEHJEHJ"/>


</StackPanel>

So just to clarify, how do I make sure that no matter how I start of the scroll, I'm always capable of scrolling in any direction. With in the grid of course. Any help would be appreciated.


回答1:


This is a known Issue that the scrollviewer runs on "rails".

Which is also stated in the artikel in msdn forums http://social.msdn.microsoft.com/Forums/wpapps/en-US/8fdbe189-c037-4f55-89c5-6d6814dc58f2/scrollviewer-locks-when-you-only-scroll-horizontally-or-vertically?forum=wpdevelop

But one could look at how to handle manipulation events for windows phone http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff426933(v=vs.105).aspx

For this you need to set ScrollViewer.ManipulationMode to Control and manage it yourself.

But as stated in the first link, to acheive smoothness is very hard.



来源:https://stackoverflow.com/questions/19592285/the-scrollviewer-locks-when-scrolling-vertically-or-horizontally

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