最近学习ObjectAnimator动画,本想让图片按着Path的路径跑起来,但是运行起来报错java.lang.NoSuchMethodError: android.animation.ObjectAnimator.ofFloat,求大神指导一二,不胜感激!!!
Path path = new Path();
path.moveTo(0, 0);
path.lineTo(400, 0);
path.lineTo(400, 400);
path.quadTo(600, 600, 0, 400);
ObjectAnimator animator = ObjectAnimator.ofFloat(imageView,View.X,View.Y,path);
animator.setDuration(4000);
animator.start();
天蓬老师2017-04-17 17:58:10
ofFloat was added after API 11. If you want to be compatible with lower versions, you can use the NineOldAndroids library