回答編集履歴

1

コード修正

2019/11/28 13:22

投稿

Rayyd
Rayyd

スコア15

test CHANGED
@@ -23,6 +23,10 @@
23
23
  imageView1=findViewById(R.id.imageview1);
24
24
 
25
25
  imageView2=findViewById(R.id.imageview2);
26
+
27
+ imageView2.setPivotX(0);
28
+
29
+ imageView2.setPivotY(0);
26
30
 
27
31
  Animator = ObjectAnimator.ofFloat( imageView2, "translationX", 100f, 500f );
28
32
 
@@ -66,13 +70,9 @@
66
70
 
67
71
  imageView2.setScaleX(scale);
68
72
 
69
- imageView2.setY((imageView2.getHeight()*scale-imageView2.getHeight())/2);
70
-
71
73
  long time = Animator.getCurrentPlayTime();
72
74
 
73
- float w=(imageView2.getWidth()*scale-imageView2.getWidth())/2;
74
-
75
- Animator = ObjectAnimator.ofFloat( imageView2, "translationX", 100f*scale+w, 500f*scale+w );
75
+ Animator = ObjectAnimator.ofFloat( imageView2, "translationX", 100f*scale, 500f*scale );
76
76
 
77
77
  Animator.setInterpolator(new LinearInterpolator());
78
78