Skip to content

Commit

Permalink
- update adapter less than ios11
Browse files Browse the repository at this point in the history
  • Loading branch information
yongyuandouneng committed Jul 20, 2018
1 parent 9478a41 commit 803a4da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -18,6 +18,8 @@

#define kYNPAGE_TABBARHEIGHT (kYNPAGE_IS_IPHONE_X ? 83 : 49)

#define kLESS_THAN_iOS11 ([[UIDevice currentDevice].systemVersion floatValue] < 11.0 ? YES : NO)

@interface UIView (YNPageExtend)

@property (nonatomic, assign) CGFloat yn_x;
Expand Down
Expand Up @@ -462,7 +462,9 @@ - (void)setupPageScrollView {
self.config.contentHeight = self.pageScrollView.yn_height;

[self.bgScrollView addSubview:self.pageScrollView];

if (kLESS_THAN_iOS11) {
[self.view addSubview:[UIView new]];
}
[self.view addSubview:self.bgScrollView];

} else {
Expand All @@ -472,7 +474,9 @@ - (void)setupPageScrollView {
self.pageScrollView.contentSize = CGSizeMake(kYNPAGE_SCREEN_WIDTH * self.controllersM.count, contentHeight - ([self isTopStyle] ? self.config.menuHeight : 0));

self.config.contentHeight = self.pageScrollView.yn_height - self.config.menuHeight;

if (kLESS_THAN_iOS11) {
[self.view addSubview:[UIView new]];
}
[self.view addSubview:self.pageScrollView];
}
}
Expand Down Expand Up @@ -734,6 +738,7 @@ - (UIScrollView *)getScrollViewWithPageIndex:(NSInteger)pageIndex {
if (scrollView) {
scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
} else {
}
}
NSAssert(scrollView != nil, @"请设置pageViewController 的数据源!");
Expand Down

0 comments on commit 803a4da

Please sign in to comment.