UIScrollView works as expected but scrollRectToVisible: does nothing

前端 未结 8 2335
一向
一向 2020-12-14 05:46

I have used UIScrollView before, and am using it now, and never had a problem. I\'m now adding it to an old app, and while it works as expected (I can look at

8条回答
  •  [愿得一人]
    2020-12-14 06:14

    The suggested solution above may still give an error if you haven't set the frame for the "clefScrollView".

    If the solution above is used and still having the same problem, make sure you have initialized your scollView (in this case clefScrollView) frame prior to setting the content view.

    
    
        clefScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,320,450)];
    
        [clefScrollView setContentSize:CGSizeMake(clefView.frame.size.width, clefView.frame.size.height)];
    
    
    
    

提交回复
热议问题