我将视图围绕 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
但这似乎没有任何效果。
如何在动画期间缩小视图的大小?