iOS UIScrollView performance

前端 未结 4 1717
清酒与你
清酒与你 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 12:14

    The line that is likely killing your performance is:

    addButton.layer.cornerRadius=10.0;

    Why? Turns out the performance for cornerRadius is AWFUL! Take it out... guaranteed huge speedup.

    Edit: This answer sums up what you should do quite clearly.

    https://stackoverflow.com/a/6254531/537213

提交回复
热议问题