1
我有4图像视图我想移动图像1移动和缩放动画的图像2的位置。 [图像动画移动和缩放在一起
我已经尝试了缩放
ObjectAnimator scaleX = ObjectAnimator.ofFloat(img1, "scaleX", (float) img2.getWidth());
ObjectAnimator scaleY = ObjectAnimator.ofFloat(img1, "scaleY", (float) img2.getHeight());
scaleX.setDuration(2000);
scaleY.setDuration(2000);
AnimatorSet scale = new AnimatorSet();
scale.play(scaleX).with(scaleY);
scale.start();
谢谢你r解决方案。但它不起作用。我刚刚检查了文档 - scale mean“设置视图在x轴上的缩放量,作为视图未缩放宽度的一部分,值为1意味着不应用缩放。” – Anirban
那么所有你需要的是scaleX()和scaleY()的其他值,例如scaleX(2)缩放为原始大小的两倍。 –
但是,我怎么能给其他imageview高和宽的价值。 – Anirban