UIScrollView's origin changes after popping back to the UIViewController

后端 未结 17 2334
不知归路
不知归路 2020-12-07 16:50

I have a UIViewController subclass as a scene in the storyboard that contains a UIScrollView containing various subviews. One of the subviews is a

17条回答
  •  执念已碎
    2020-12-07 17:08

    i had a similar problem, after dismissing a viewController, the contentOffset from my tableView was changed to (0, -64).

    my solution was a little weird, i tried all the other answers but had no success, the only thing that fixed my problem was to switch the tableView position in the controls tree of the .xib

    it was the first control in the parent View like this:

    before

    I moved the tableView right after the ImageView and it worked:

    after

    it seems that putting the table view in the first position was causing the trouble, and moving the table view to another position fixed the problem.

    P.D. I'm not using autoLayout neither storyboards

    hope this can help someone!

提交回复
热议问题