UIScrollView wrong offset with Auto Layout

前端 未结 7 925
逝去的感伤
逝去的感伤 2020-12-12 22:19

I have a fairly simple view configuration:

A UIViewController, with a child UIScrollView and a UIImageView in this UIScr

相关标签:
7条回答
  • 2020-12-12 23:04

    The edit didn't work for me. But this worked:

    -(void)viewWillDisappear:(BOOL)animated
    {
         [super viewWillDisappear:animated];
    
         self.tempContentOffset = self.scrollView.contentOffset;
         self.scrollView.contentOffset = CGPointZero;
    }
    
    - (void)viewDidLayoutSubviews {
         [super viewDidLayoutSubviews];
         self.scrollView.contentOffset = self.tempContentOffset;
    }
    
    0 讨论(0)
提交回复
热议问题