这是答案,虽然它只适用于3.0及以上版本。
1)创建一个名为“animator”的新资源文件夹。
2)创建一个新的.xml文件,我将其称为“翻转”。使用以下xml代码:
android:valueFrom="0" android:valueTo="360" android:propertyName="rotationY" >
否,objectAnimator标签不以大写“O”开头。
3)使用以下代码启动动画:
ObjectAnimator anim = (ObjectAnimator) AnimatorInflater.loadAnimator(mContext,R.animator.flipping);
anim.setTarget(A View Object reference goes here i.e. ImageView);
anim.setDuration(3000);
anim.start();
我从here收到了这一切。