[英]C# WinRT/Metro app - ScrollViewer paging
I need to implement horizontal paging functionality on ScrollViewer
like in iOS. 我需要像在iOS中那样在ScrollViewer
上实现水平分页功能。 To do that I need to catch the event when ScrollViewer
did ends decelerating, but ScrollViewer
doesn't have that kind of events like in IOS, eg 为此,我需要在ScrollViewer
确实结束减速时捕获事件,但是ScrollViewer
没有像IOS这样的事件,例如
-scrollViewDidEndDecelerating:
-scrollViewDidEndScrollingAnimation:
,etc... -scrollViewDidEndScrollingAnimation:
等
Does any one know how to catch those events, or suggest a better method how to achieve paging functionality, or may be you know a 3rd party already implemented ScrollViewer with paging? 是否有人知道如何捕获这些事件,或者提出了一种更好的方法来实现分页功能,或者您知道第3方已经通过分页实现了ScrollViewer?
I'm not sure what paging means in iOS, but if I am guessing correctly - you might be interested in looking at HorizontalSnapPointsAlignment
and HorizontalSnapPointsType
properties. 我不确定分页在iOS中的含义,但是如果我猜对了,您可能会对查看HorizontalSnapPointsAlignment
和HorizontalSnapPointsType
属性感兴趣。 Or even better just use the FlipView
control. 甚至更好的方法是使用FlipView
控件。 The two properties will allow the ScrollViewer
to automatically snap to elements of the ItemsPanel(Root)
, so for example if the panel is an (Items)StackPanel
- it will snap to the elements of that and thus give you the page snap behavior in a control similar to the FlipView
. 这两个属性将允许ScrollViewer
自动捕捉到ItemsPanel(Root)
元素,因此例如,如果面板是(Items)StackPanel
它将捕捉到该元素的元素,从而为您提供页面捕捉行为控件类似于FlipView
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.