我有使用动画的卡图像,我只是想使其看起来像3D卡。 我认为翻转动画可以做到,但无法实现。
动画xml
<?xml version="1.0" encoding="utf-8"?>
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:propertyName="rotationX"
android:valueFrom="180"
android:valueTo="40"/>
Java代码
ImageView imageView = findViewById(R.id.iv_1);
ObjectAnimator anim = (ObjectAnimator) AnimatorInflater.
loadAnimator(this, R.animator.flipper);
anim.setTarget(imageView);
anim.setDuration(3000);
anim.start();
我使用过代码,但是它使imageview看起来像正方形。