0
我圍繞X軸旋轉90度視圖。 (也就是說,視圖朝向用戶的屏幕前進)。Android簡單動畫 - 圍繞X軸旋轉90度
我向動畫,和裏面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
但這似乎沒有任何效果。
如何在動畫過程中縮小視圖的大小?