动画后自定义视图位置

时间:2014-02-20 12:02:01

标签: android android-animation android-custom-view

我在onDraw()方法中创建了一个包含20个等度的弧的自定义视图(圆圈)。

enter image description here

  protected void onDraw(Canvas canvas) {
      for (int i = 0; i < value_degree.length; i++) {
            if (i >= 0) {
                temp += (int) value_degree[i];
                paint.setColor(COLORS[i]);
                canvas.drawArc(rectf, temp, value_degree[i], true, paint); 
          //then i attach text and collor to each arc....

            }

我确实在视图上附加了动画,因此圆圈可以在其中心旋转,并且在狙击后弧线的位置可以改变

 public void createAnimation(float vel) {
        anim = new RotateAnimation(animStart, vel, centerXX, centerYY);

        anim.setFillAfter(true);
        anim.setFillEnabled(true);   
        anim.setDuration(1000L);

        startAnimation(anim);
    }

有什么方法可以在动画结束后知道屏幕上弧线的位置吗?例如,相对于屏幕的度数,顶部红色弧线是72 t 90度。

0 个答案:

没有答案
相关问题