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

转场动画与wrPopProgress计算问题 #199

Open
yexiannan opened this issue Dec 31, 2021 · 1 comment
Open

转场动画与wrPopProgress计算问题 #199

yexiannan opened this issue Dec 31, 2021 · 1 comment

Comments

@yexiannan
Copy link

问题:透明度为1页面pop到透明度为0页面时,转场动画未按照设置执行0.12s而是0.5s,且wrPopProgress计算有问题,导致0.12s到0.5s转场动画结束前,导航栏背景色并未完全变为预期的效果
截屏2021-12-31 下午4 08 57
截屏2021-12-31 下午4 12 32

@yexiannan
Copy link
Author

yexiannan commented Dec 31, 2021

暂时将计算进度时小数点第一位后向上取整解决

static CGFloat wrPopDuration = 0.12;
static int wrPopDisplayCount = 0;
- (CGFloat)wrPopProgress {
    CGFloat all = 60 * wrPopDuration;
    int current = MIN(all, wrPopDisplayCount);
    CGFloat progress = current / all;
    return ceilf(progress * 10) / 10.f;
}

static CGFloat wrPushDuration = 0.10;
static int wrPushDisplayCount = 0;
- (CGFloat)wrPushProgress {
    CGFloat all = 60 * wrPushDuration;
    int current = MIN(all, wrPushDisplayCount);
    CGFloat progress = current / all;
    return ceilf(progress * 10) / 10.f;
}

转场动画持续时间修改无效可能跟苹果动画效果改为usingSpringWithDamping有关

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

1 participant