UIScrollView scroll not working after pushed with a navigation controller

前端 未结 2 1895
心在旅途
心在旅途 2021-01-22 09:12

I\'m having an odd problem. I have a UIScrollView in a part of view hierarchy. It\'s working just fine when the view is presented via UITabBarController, but doesn\'t work at al

2条回答
  •  清歌不尽
    2021-01-22 09:20

    I've solved this problem, but forgot to post it...

        - (void) viewDidLayoutSubviews 
        {
            [self resizeScrollViewContent];
        }
    
        - (void) resizeScrollViewContent
        {
            self.scrollView.contentSize = CGSizeMake(320.0f, 468.0f);
        }
    

    Or you could use this as well:

        - (void) viewDidLayoutSubviews 
        {
            self.scrollView.contentSize = CGSizeMake(320.0f, 468.0f);
        }
    

提交回复
热议问题