我围绕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
但这似乎没有任何效果。
如何在动画期间缩小视图的大小?
答案 0 :(得分:0)
尝试使用matrix.preScale(x,x,x,x);