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

前端 未结 6 852
-上瘾入骨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:00

    To solve this problem i use this code:

    -(void) viewWillAppear:(BOOL)animated{
        [super viewWillAppear:animated];
    
        [self.scrollview scrollRectToVisible:CGRectMake(0, 0, 1, 1)
                                    animated:NO];   
    }
    

提交回复
热议问题