Code Monkey home page Code Monkey logo

Comments (2)

mahailin avatar mahailin commented on July 24, 2024

1、有两处循环引用,修改如下:
(1)、增加属性声明
@Property (nonatomic, strong) UICollectionView *collectionView;
@Property (nonatomic, strong) XLImageViewerTooBar *toolBar;
(2)、弱化引用
__weak __typeof(self) weakSelf = self;
[cell addHideBlockStart:^{
[weakSelf.toolBar hide];
} finish:^{
[weakSelf removeFromSuperview];
} cancle:^{
[weakSelf.toolBar show];
}];
(3)、弱化引用
__weak __typeof(self) weakSelf = self;
[_collectionView performBatchUpdates:nil completion:^(BOOL finished) {
XLImageViewerItem *item = (XLImageViewerItem *)[weakSelf.collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];
[item showEnlargeAnimation];
}];

[[UIApplication sharedApplication].keyWindow addSubview:self];
2、当下拉图片后再上拉到contentoffset<0后放手,XLImageViewerTooBar界面不见了,修改如下:
在scrollViewPanMethod方法里修改 if (_scrollView.contentOffset.y > 0)
{
return;
}

if (_scrollView.contentOffset.y > 0)
{
_cancleideBlock();
return;
}
3、当下拉图片到contentoffset大于0小于100后放手,背景透明度有问题,修改如下:
增加如下方法:

  • (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];
    }
    }

from xlimageviewer.

mengxianliang avatar mengxianliang commented on July 24, 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.