Android:ImageView上的矩阵操作,动画?
我正在使用矩阵来平移/缩放ImageView,在setImageMatrix之后,结果直接显示,有没有办法让它动画化?
谢谢!
I am using matrix to translate/scale an ImageView, after setImageMatrix, the result is shown directly, is there anyway to make it animated?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
放大将是平移和缩放的组合:
缩小将涉及放大上的反向插值器,之后您可以按照正常方式在图像视图上调用 startAnimation :
Zooming in would be a combination of both translate and scale:
Zooming out would involve a reverse interpolator on the zoom in, after which you can call startAnimation on your image view as per normal:
您可以尝试使用 Honeycomb 中引入的新动画框架,但我不知道这是否可以直接用于图像矩阵。您可以将与矩阵一起应用的变换转换为基本动画变换,例如缩放、平移、旋转、alpha。
如果您的目标是 Android 2.x 设备,您可以使用 Jake Wharton 的 NineOldAndroids [1],它是 Honeycomb 新动画框架的向后移植。它非常易于使用,因为它模仿了您在 11 种以上设备上使用的相同 API。
[1] http://nineoldandroids.com/
You could try using the new Animation Framework introduced in Honeycomb, but I don't know if this will work directly with image matrices. You could convert the transformation you are applying with your matrix to elementary animation transformations, such as scale, translate, rotate, alpha.
If you are targeting Android 2.x devices you could use Jake Wharton's NineOldAndroids [1] which is a backport of the Honeycomb new Animation Framework. It is very easy to use, as it mimics the same API you would use on 11+ devices.
[1] http://nineoldandroids.com/