How to reset my UIScrollView's position after returning from a modal transition?

前端 未结 6 835
-上瘾入骨i
-上瘾入骨i 2021-02-07 12:46

I have a simple view containing a long view with many buttons, with the whole thing being in a UIScrollView. The scroller works well, and I can s

6条回答
  •  攒了一身酷
    2021-02-07 13:03

    try this code:

    - (void)viewWillAppear:(BOOL)animated
    {
      [yourscrollview setContentOffset:CGPointZero animated:YES];
    }
    

提交回复
热议问题