Comments (2)
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.
你真的看的很仔细,谢谢你提出的问题,已经改好了。
from xlimageviewer.
Related Issues (12)
- 使用MLeaksFinder检测到循环引用问题 HOT 1
- 保存图片缺少权限提示 HOT 1
- TooBar 没有适配iPhone X
- 图片向下滑动取消,页面会闪烁
- frame转换在ios9以下会变为2倍 HOT 1
- XLImageViewer 会对传入的 Container 有一次强引用 HOT 1
- cocoapods 导入问题 HOT 1
- 图片快速向下滑动取消的时候,页面会闪烁一下,慢慢滑动没有这个问题. HOT 3
- 不支持GIF么 HOT 2
- 建议增加滚动的回调代理或者Block方法
- 再加个需求,加入视频的支持
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xlimageviewer.