Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[error] P268 页中scale、rotate的pivotX、pivotY默认都为0,而不是view的中心点 #22

Open
onlylemi opened this issue Jul 13, 2016 · 2 comments

Comments

@onlylemi
Copy link

已经过测试验证。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;
    }
@lzhui1994
Copy link

I agree

@lzhui1994
Copy link

I saw that in the resourceCode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants