android-art-res
android-art-res copied to clipboard
[error] P268 页中scale、rotate的pivotX、pivotY默认都为0,而不是view的中心点
已经过测试验证。P268 页中提到 View 动画,scale、rotate的pivotX、pivotY轴心点默认都为0,而不是view的中心点。
RotateAnimation 的构造函数
public RotateAnimation(float fromDegrees, float toDegrees) {
mFromDegrees = fromDegrees;
mToDegrees = toDegrees;
// 默认为0.0,也就是view的左上点坐标
mPivotX = 0.0f;
mPivotY = 0.0f;
}
ScaleAnimation 的构造函数
public ScaleAnimation(float fromX, float toX, float fromY, float toY) {
mResources = null;
mFromX = fromX;
mToX = toX;
mFromY = fromY;
mToY = toY;
mPivotX = 0;
mPivotY = 0;
}
I agree
I saw that in the resourceCode