UIScrollView redrawing content while scrolling?

2019-07-08 21:25发布

问题:

I know there is a property or method that makes the scrollview/uiview call drawRect: method while is scrolling. By default is disabled because of performance reasons but I need to enable it. I cannot remember the name of the method hence I cannot look for it, anyone who knows what I am looking for?

Thanks in advance

回答1:

I'ld suggest to use the scrollViewDidScroll:-method and then redraw the view.

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    [someView setNeedsDisplay];
}