当前位置: 动力学知识库 > 问答 > 编程问答 >

canvas - Android ImageView pan animation with scaleType centerCrop

问题描述:

I have an ImageView set to scaleType="centerCrop" , I am trying to create an animation which pans this ImageView to its left and right edges, which are outside of the bounds of the view.

How would I do this?

Normally when animating I have the full view on screen already, but in this case the ImageView itself is rendered but its source is scaled outside the bounds of its view. So if I was just animating the VIEW itself I won't be accessing the source.

This may have something more to do with animating on a canvas within an imageview, instead of moving the X, Y position of the imageview itself. Insight appreciated

Regarding the "too broad" allegation to close this question, yeah, it isn't.

网友答案:

I was able to do this with the KenBurnsView library object

https://github.com/flavioarfaria/KenBurnsView

I modified my version to use my custom imageview objects which extend NetworkImageView from Volley

分享给朋友:
您可能感兴趣的文章:
随机阅读: