Comments (3)
-
(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.
scrollViewDidScroll 里面的代码可以去掉,
下面加一行
_collectionView.backgroundColor = [UIColor colorWithWhite:0 alpha:1];
就可以修复这个问题
from xlimageviewer.
好的 谢谢
from xlimageviewer.
Related Issues (12)
- 使用MLeaksFinder检测到循环引用问题 HOT 1
- frame转换在ios9以下会变为2倍 HOT 1
- 存在问题及解决方案 HOT 2
- XLImageViewer 会对传入的 Container 有一次强引用 HOT 1
- cocoapods 导入问题 HOT 1
- 不支持GIF么 HOT 2
- 建议增加滚动的回调代理或者Block方法
- 再加个需求,加入视频的支持
- 保存图片缺少权限提示 HOT 1
- TooBar 没有适配iPhone X
- 图片向下滑动取消,页面会闪烁
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.