Skip to content

Commit

Permalink
prevent system automaticallyAdjustsScrollViewInsets
Browse files Browse the repository at this point in the history
  • Loading branch information
12207480 committed Jul 21, 2018
1 parent b4dfecb commit 3c44bb3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion TYPagerControllerDemo/TYPagerController/TYPagerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,16 @@ - (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor whiteColor];

// prevent sysytem automaticallyAdjustsScrollViewInsets
[self addFixAutoAdjustInsetScrollView];
[self.view addSubview:self.layout.scrollView];
}

- (void)addFixAutoAdjustInsetScrollView {
UIView *view = [[UIView alloc]init];
[self.view addSubview:view];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
_layout.scrollView.frame = UIEdgeInsetsInsetRect(self.view.bounds,_contentInset);
Expand Down

0 comments on commit 3c44bb3

Please sign in to comment.