.h file
@property (assign,nonatomic) CGPoint scrollviewContentOffsetChange;
@property (assign,nonatomic) CGPoint scrollviewContentOffsetChange;
.m file
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.scrollView.contentOffset = CGPointZero;
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
self.scrollviewContentOffsetChange = self.scrollView.contentOffset;
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
self.scrollView.contentOffset = self.scrollviewContentOffsetChange;
}
No comments:
Post a Comment