Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ - (void)setupUI {
scrollView.showsHorizontalScrollIndicator = false;
scrollView.pagingEnabled = true;
scrollView.delegate = self;
//如果是iOS11的系统, 则不自动调整内边距
if (@available(iOS 11.0, *)) {
if ([scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}
[self addSubview:scrollView];
self.scrollView = scrollView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ - (void)setupUI {
self.showsHorizontalScrollIndicator = false;
self.showsVerticalScrollIndicator = false;
self.maximumZoomScale = 2;

if (@available(iOS 11.0, *)) {
if ([self respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}
// 添加 imageView
YYAnimatedImageView *imageView = [[YYAnimatedImageView alloc] init];
imageView.clipsToBounds = true;
Expand Down