UIScrollview Autolayout Issue

前端 未结 9 687
广开言路
广开言路 2020-12-05 07:19

I have a problem with autolayout(maybe) and my scrollview!

My Problem

  1. I scroll down \"View\"
9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 07:43

    The following code snippet in the containing view controller also seems to solve the problem, without relying on explicit sizes:

    - (void)viewDidDisappear:(BOOL)animated {
      [super viewDidDisappear:animated];
      self.mainScrollView.contentOffset = CGPointZero;
    }
    

    It does reset the content offset to the origin, but it seems that so do the other answers.

提交回复
热议问题