Commit 26a4a47c authored by Zhen Tan's avatar Zhen Tan Committed by GitHub

Merge pull request #115 from Arthurli/feature-recover-cells

当图片划出屏幕的时候 恢复 cell 缩放状态
parents e6bd9dc9 e160e8a0
......@@ -14,4 +14,6 @@
@property (nonatomic, strong) TZAssetModel *model;
@property (nonatomic, copy) void (^singleTapGestureBlock)();
- (void)recoverSubviews;
@end
......@@ -69,6 +69,11 @@
}];
}
- (void)recoverSubviews {
[_scrollView setZoomScale:1.0 animated:NO];
[self resizeSubviews];
}
- (void)resizeSubviews {
_imageContainerView.tz_origin = CGPointZero;
_imageContainerView.tz_width = self.tz_width;
......
......@@ -274,6 +274,20 @@
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
if ([cell isKindOfClass:[TZPhotoPreviewCell class]]) {
[(TZPhotoPreviewCell *)cell recoverSubviews];
}
}
- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
if ([cell isKindOfClass:[TZPhotoPreviewCell class]]) {
[(TZPhotoPreviewCell *)cell recoverSubviews];
}
}
#pragma mark - Private Method
- (void)refreshNaviBarAndBottomBarState {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment