简体   繁体   English

在ScrollViewer中以编程方式对缩放因子进行动画处理

[英]Animate zoom factor programmatic in a ScrollViewer

Is there a way that I can animate changing the zoom factor of a ScrollViewer for Windows Runtime? 有没有一种方法可以使Windows View Runtime的ScrollViewer的缩放因子产生动画效果?

I'd like to be able to have an image inside one respond to a tapped event by returning to a default zoom of 1. While it seems that in Windows 8.1 Change View lets you animate the scrolling, not the zooming I'd like to be able to animate both. 我希望能够通过返回默认的缩放比例1来使其中的图像响应点击事件。虽然在Windows 8.1中,“ 更改视图”似乎使您可以设置滚动动画,而不是我想要的缩放动画能够同时动画。

The best solution I found was to take a part of the WinRT XAML Toolkit which has a functioning example and an extension for ScrollViewer which does just this. 我发现最好的解决方案是加入WinRT XAML Toolkit的一部分,该工具包包含一个有效的示例以及为此而做的ScrollViewer扩展。

Also by setting the ScrollViewer to have size of Auto and simply re-sizing the width properties of whatever element is contained within you can achieve largely the same effect. 同样,通过将ScrollViewer设置为Auto的大小,然后简单地重新调整包含在其中的任何元素的width属性的大小,就可以实现大致相同的效果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM