iOS UIScrollView performance

前端 未结 4 1721
清酒与你
清酒与你 2021-01-14 11:30

I\'m trying to increase the scrolling performance of my UIScrollView. I have a lot of UIButtons on it (they could be hundreds): every button has a

4条回答
  •  生来不讨喜
    2021-01-14 11:55

    My most common solution is to rasterize the Views:

    _backgroundView.layer.shouldRasterize = YES;
    _backgroundView.layer.rasterizationScale = [[UIScreen mainScreen] scale];
    

    But it works not in every situation.. Just try it

提交回复
热议问题