UIScrollView has a different y position when seguing from different view controllers

后端 未结 2 1278
有刺的猬
有刺的猬 2021-01-28 06:14

Not sure how to explain this, simply when seguing from one controller the scroll view is lower on the screen than from another segue where it is correct.

相关标签:
2条回答
  • 2021-01-28 07:04

    Set this 2 scrollview property and check it.

    self.scrollView.contentOffset = CGPointZero;
    self.scrollView.contentInset = UIEdgeInsetsZero;
    

    Check this answer it may help you UIScrollView adjusts contentOffset when contentSize changes

    0 讨论(0)
  • 2021-01-28 07:07

    Select your view controller which has lower scroll view and unselect Adjust Scroll View Insets

    See below image:


    or you can do it programmatically

    self.scrollView.contentOffset = CGPointZero;
    self.scrollView.contentInset = UIEdgeInsetsZero;
    
    0 讨论(0)
提交回复
热议问题