GithubHelp home page GithubHelp logo

Comments (3)

lvpeng0412 avatar lvpeng0412 commented on May 28, 2024
  • (void)scrollViewDidScroll:(UIScrollView *)scrollView {

    /if (ABS(_scrollView.contentOffset.y) < minPanLength) {
    CGFloat alpha = 1 - ABS(_scrollView.contentOffset.y / (_scrollView.bounds.size.height));
    _collectionView.backgroundColor = [UIColor colorWithWhite:0 alpha:alpha];
    }
    /
    }

  • (void)scrollViewPanMethod:(UIPanGestureRecognizer *)pan {
    if (_scrollView.zoomScale != 1.0f) {return;}
    if (_scrollView.contentOffset.y > 0) {
    _cancleideBlock();
    return;
    }
    //拖拽结束后判断位置
    if (pan.state == UIGestureRecognizerStateEnded) {
    if (ABS(_scrollView.contentOffset.y) < minPanLength) {
    _cancleideBlock();
    [UIView animateWithDuration:0.35 animations:^{
    _## collectionView.backgroundColor = [UIColor colorWithWhite:0 alpha:1];
    _scrollView.contentInset = UIEdgeInsetsZero;
    }];
    } else {
    [UIView animateWithDuration:0.35 animations:^{
    //设置移除动画
    CGRect frame = _imageView.frame;
    frame.origin.y = _scrollView.bounds.size.height;
    _imageView.frame = frame;
    _collectionView.backgroundColor = [UIColor colorWithWhite:0 alpha:0];
    } completion:^(BOOL finished) {
    //先通知上层返回
    _finishHideBlock();
    //重置状态
    _imageView.frame = [self imageViewFrame];
    _scrollView.contentInset = UIEdgeInsetsZero;
    }];
    }
    } else {
    //拖拽过程中逐渐改变透明度
    _scrollView.contentInset = UIEdgeInsetsMake(-_scrollView.contentOffset.y, 0, 0, 0);
    CGFloat alpha = 1 - ABS(_scrollView.contentOffset.y / (_scrollView.bounds.size.height));
    _collectionView.backgroundColor = [UIColor colorWithWhite:0 alpha:alpha];
    _startHideBlock();
    }
    }

from xlimageviewer.

lvpeng0412 avatar lvpeng0412 commented on May 28, 2024

scrollViewDidScroll 里面的代码可以去掉,
下面加一行
_collectionView.backgroundColor = [UIColor colorWithWhite:0 alpha:1];
就可以修复这个问题

from xlimageviewer.

 avatar commented on May 28, 2024

好的 谢谢

from xlimageviewer.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.