Skip to content

Commit e403d3b

Browse files
committed
修复图片浏览中在顶部双手缩放,底部放大的部分无法显示问题。
1 parent 6ec3f14 commit e403d3b

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

Coding_iOS/Vendor/MJPhotoBrowser/MJPhotoView.m

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,7 @@ - (void)adjustFrame
170170
self.minimumZoomScale = minScale;
171171
self.zoomScale = minScale;
172172

173-
CGRect imageFrame = CGRectMake(0, 0, boundsWidth, imageHeight * boundsWidth / imageWidth);
174-
// 内容尺寸
175-
self.contentSize = CGSizeMake(0, imageFrame.size.height);
176-
177-
// y值
178-
if (imageFrame.size.height < boundsHeight) {
179-
imageFrame.origin.y = floorf((boundsHeight - imageFrame.size.height) / 2.0);
180-
} else {
181-
imageFrame.origin.y = 0;
182-
}
183-
173+
CGRect imageFrame = self.bounds;
184174
if (_photo.firstShow) { // 第一次显示的图片
185175
_photo.firstShow = NO; // 已经显示过了
186176
_imageView.frame = imageFrame;
@@ -203,7 +193,6 @@ - (void)adjustFrame
203193

204194
#pragma mark - UIScrollViewDelegate
205195
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
206-
[_imageView setY:MAX((CGRectGetHeight(self.bounds)-CGRectGetHeight(_imageView.frame))/2, 0.0)];
207196
return _imageView;
208197
}
209198

0 commit comments

Comments
 (0)