如何旋转/翻转android imageView?

jon*_*ney 5 android android-animation android-imageview

我试图以一种方式旋转/翻转imageView,其中所讨论的图像(卡片)翻转到它的另一侧,即沿其Z轴旋转3d动画.那可能吗?

我在下面写了这个代码,但它只在2d中旋转,只改变它的方向而不是它的一面.

// animations
    private static final float ROTATE_FROM = 0.0f;
    private static final float ROTATE_TO = -10.0f * 360.0f;
    private RotateAnimation mRotateAnimation;

mRotateAnimation = new RotateAnimation(ROTATE_FROM, ROTATE_TO, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
        mRotateAnimation.setDuration((long)2 * 150);
        mRotateAnimation.setRepeatCount(0);


mCardImage.startAnimation(mRotateAnimation);
Run Code Online (Sandbox Code Playgroud)