Can a panorama viewer effect be done with Translat

2019-04-15 20:35发布

I made an Image Viewer with TouchImageView that I forked to my needs. In particular, you can fit the image vertically in the screen, and then drag the image from left to right. This is nice for a panorama, for example, that you can drag and see it all.

Now I want to do exactly this with panoramas without touching the screen, that is, an automatic constant drag.

I tried to implement this through a TranslateAnimation, but failed miserably: TranslateAnimation "moves the view", and the image is slowly being replaced with a growing black strip instead of more image.

Of course I can move the image 1 pixel, wait 1/100s, move again and so on, but there should be an easier way (and consuming less resources).

Is there some option in TranslateAnimation that allows to do this? How would you do it?

Thanks!!

0条回答
登录 后发表回答