在对 ImageView 应用变换后,如何为它设置动画?
我正在尝试为图像查看器实现缩放和拖动功能。到目前为止,我创建了自定义 ImageView 并使用视图的变换矩阵实现了捏缩放和拖动的实际功能。现在我想为从最后一个位置到合法位置的过渡设置动画(用户可以将图像拖动到他/她想要的位置,但当它被释放时,它应该反弹回来)。如果我只是对变换矩阵进行修改,它就可以工作,但正如我所说,我想要动画。
我的问题是,如果图像超出屏幕并且我将视图动画化,则即使动画完成后,图像也会被剪切并保持截断状态。我应该提到的是,图像是使用 setImageUri 方法设置的。
有人对此有任何想法吗?
I am trying to implement the zoom and drag features for an image viewer. So far I created the custom ImageView and implemented the actual features for pinch zoom and drag using the transformation matrix of the view. Now I want to animate the transition from the last position to a legal one (the user can drag the image where he/she wants but when it is released it should bounce back). If I just make modifications on the transformation matrix it works but, as I said, I want animations.
My problem is that if the image is out of the screen and I animate the view back the image is cut and remains truncated even after the animation is finished. I should mention that the image is set using the setImageUri method.
Does anyone have any idea on this one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论