如何以编程方式滚动滚动查看器并保留动画
我有一个页面,其内容水平比手机宽,有点像全景图,但没有所有视差内容,我想让用户轻弹滚动,并按下按钮滚动到滚动查看器中指定的偏移量。 ScrollToHorizontalOffset 对于按钮来说效果很好,只是它丢失了动画,而我想保留动画。
I have a page whose contents are horizontally wider than the phone, sort of like a Panorama but without all the parallax stuff, and I want to let the user flick to scroll, and also press a button to scroll to specified offsets within the scrollviewer. ScrollToHorizontalOffset works fine for the button, except that it loses the animation, and I want to retain the animation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我正在做一件非常相似的事情。我创建了 WizardControl 和 WizardPage 用户控件。用户可以在页面之间滑动或使用下一个和上一个按钮。
我创建了一个幻灯片效果动画来在页面之间移动。代码如下:
MainPanel 是一个水平堆栈面板。向导页面已添加到其中。
_pageWidth 很重要,因为它在纵向和横向模式下都有效。
使用pagestoMove是因为我有一个按钮可以直接返回第一页。
更新 - 添加向导主面板定义和添加页面方法
I am doing a very similar thing. I have created WizardControl and WizardPage user controls. The user can flick between pages or use next and previous buttons.
I have created a slide effect animation to move between pages. Here is the code:
MainPanel is a horizontal stack panel. Wizard pages are added to it.
_pageWidth matters as this works in both portrait and landscape mode.
pagestoMove is used as I have a button to return directly to the first page.
UPDATE - added Wizard main panel def and add page method