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

图片未加载完成下拉消失和视频下拉消失的时候,动画位置对不上 #336

Open
TingTauren opened this issue Jun 3, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@TingTauren
Copy link

TingTauren commented Jun 3, 2021

Feature Description

图片未加载完成下拉消失和视频下拉消失的时候,动画位置对不上
但是点击隐藏的时候位置是正确的,我不知道该如何去计算endFrame的数据
但是视频的效果确实无法忍受,于是我想到了使用点击隐藏的endFrame位置来消失
在YBIBAnimatedTransition.m文件中的

  • (void)yb_hideTransitioningWithContainer:(UIView *)container startView:(nullable __kindof UIView *)startView endView:(UIView *)endView orientation:(UIDeviceOrientation)orientation completion:(void(^)(void))completion;方法中的YBIBTransitionTypeCoherent类型判断下添加了如下代码
    "NSString *classStr = NSStringFromClass(startView.superview.class);
    if ([classStr isEqualToString:@"YBIBVideoView"]) {
    startView.superview.frame = container.frame;
    }"
    添加后是这样的
    “case YBIBTransitionTypeCoherent: {
    NSString *classStr = NSStringFromClass(startView.superview.class);
    if ([classStr isEqualToString:@"YBIBVideoView"]) {
    startView.superview.frame = container.frame;
    }
    CGRect startFrame = startView.frame;...”
    如果你想让图片未加载完之前下拉消失也变成这样效果就不需要判断classStr 是 YBIBVideoView 字符串,切记:”如果不筛选是视频的话,你的图片加载完成后下拉消失效果也会同步变成这样,损失了图片加载完成原本丝滑的动画“。当然你能判断图片是否加载完成的状态,加以判断那将更不错。
    如果有哪位朋友修复了此问题请告诉我们广大使用者,非常感谢!
    如果作者有空修复该问题那就很棒了!
@TingTauren TingTauren added the enhancement New feature or request label Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant