UIScrollView contentOffset change after another view pushed

后端 未结 6 2023
遇见更好的自我
遇见更好的自我 2020-12-31 17:26

I have a UIViewController in Interface Builder, and I add a UIScrollView to the UIView. It has a contentOffset property e

6条回答
  •  耶瑟儿~
    2020-12-31 18:16

    See my answer to a similar question.

    You need to set the scrollview's contentOffset appropriately in viewWillAppear: and viewWillDisappear:.

    Also, see this:

    • This answer to the question UIScrollView's origin changes after popping back to the UIViewController.
    • This related question, UIScrollview Autolayout Issue.

提交回复
热议问题