是否可以使用Picasso在Android平台上翻译ImageView?

时间:2016-09-23 21:07:31

标签: android picasso

例如,如果我将图像加载到ImageView中:

Imeteor = (ImageView) findViewById(R.id.meteor1);
Picasso.with(this)
                .load(R.drawable.red_meteor)
                .resize((int) meteorWidth, (int) meteorHeight)
                .into(Imeteor);

是否可以翻译(在屏幕上移动或移动屏幕)使用Picasso表示ImageView?我目前使用的方法如下。

 Imeteor = (ImageView) findViewById(R.id.meteor1);
 Imeteor.setX(meteorXPosition);
 Imeteor.setY(meteorYPosition);

使用" meteorXPosition"和" meteorYPosition"的值。以与加载图像的单独方法进行更新。此外," meteorXPosition"和" meteorYPosition"每毫秒更新一次。

或者,

由于使用Picasso加载图像,这是否意味着每次访问ImageView时都会通过Picasso访问它?例如,通过我在上面提供的代码

 Imeteor = (ImageView) findViewById(R.id.meteor1);
 Imeteor.setX(meteorXPosition);
 Imeteor.setY(meteorYPosition);

1 个答案:

答案 0 :(得分:0)

对于任何可能阅读本文的人,并且不愿意阅读评论。 Picasso仅处理加载位图,并在图像视图中对位图执行转换。要在图像视图中移动位图,可以选择使用图像视图的setX()和setY()函数。这会将图像视图移动到新位置(位图位于图像视图中)。对于移动图像,最好查找如何移动图像视图。