开发者

Do offscreen UIScrollView pages amount to a great pixel-burden?

开发者 https://www.devze.com 2023-02-12 20:49 出处:网络
I have a paging-enabled UIScrollView filled with hundreds of UIViewControllers, each adding its UIView (a PDF page) to the UIScrollView. In terms of performance, with a large number of offscreen pages

I have a paging-enabled UIScrollView filled with hundreds of UIViewControllers, each adding its UIView (a PDF page) to the UIScrollView. In terms of performance, with a large number of offscreen pages, is there more o开发者_运维问答f a burden due to the large number of offscreen pixels needed to be drawn into the buffer for the Scroll view? I seek general answers relating to the method in which offscreen pixel drawing of UIScrollView occurs.


Yes , you are actually bearing two costs here. One for the initialization/allocation of the thousand views and the other for rendering those when you add them to the scrollView. I would recommend creating a 'sliding window' of 5 pages and creating each page on the fly.

0

精彩评论

暂无评论...
验证码 换一张
取 消