2013-01-17 4 views
0

X 축을 중심으로 90도 회전합니다. (즉,보기가 화면 밖으로 사용자쪽으로 앞으로 떨어지는 것처럼 보입니다).Android 간단한 애니메이션 - X 축을 중심으로 90도 회전

  1. 나는 애니메이션을 확장하고, applyTransformation() 안에, 내가 잘 작동

    protected void applyTransformation(float interpolatedTime, Transformation t) { 
    final float fromDegrees = mFromDegrees; 
    float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime); 
    
    final float centerX = mCenterX; 
    final float centerY = mCenterY; 
    final Camera camera = mCamera; 
    
    final Matrix matrix = t.getMatrix(); 
    
    camera.save(); 
    camera.rotateX(degrees); 
    camera.getMatrix(matrix); 
    camera.restore(); 
    
    matrix.preTranslate(-centerX, -centerY); 
    
    matrix.setScale(0.75f, 0.75f); // doesn't do anything 
    
    matrix.postTranslate(centerX, centerY); 
    

    }

을, 그리고 내가 원하는 애니메이션을 얻을.

애니메이션을 적용 할 때보기의 크기를 약간 줄이기를 원합니다.

나는 이것이 (위의 코드에 표시된 장소에서) 그렇게 할 것이라고 생각했습니다.

 matrix.setScale(0.75f, 0.75f); // doesn't do anything 

하지만 효과가없는 것으로 보입니다.

애니메이션 중에 뷰의 크기를 어떻게 축소 할 수 있습니까?

답변

0

matrix.preScale (x, x, x, x); 사용을 시도하십시오.

관련 문제