轮换问题imageview

时间:2014-05-14 13:21:26

标签: android rotation imageview

我试图旋转我的imageview它有一个空间图像我想要星星和主星旋转。但我无法做到。我使用什么样的比例类型从未奏效。黑色空间仍然出现。 Sample Image Position

我使用的代码是:

        DisplayMetrics metrics ;
    metrics = getApplicationContext().getResources().getDisplayMetrics();

    int centerX = metrics.widthPixels/2;
    int centerY = metrics.heightPixels/2;
    Animation an = new RotateAnimation(0.0f, 360.0f, centerX, centerY);

    // Set the animation's parameters
    an.setDuration(10000);               // duration in ms
    an.setRepeatCount(-1);                // -1 = infinite repeate
    an.setFillAfter(true);               // keep rotation after animation
    diskView.setAnimation(an);

希望你能帮助我。

0 个答案:

没有答案