Scaling in UIScrollView is not smooth

I created a clone minesweeper game on iphone. My embedding of cells in a grid is that I created a UIView and added buttons to UIView and then added UIView to UIScrollView, but every time I zoom in or out using the zoomToRect UIScrollView method, the scaling is not smooth and the distortion was distorted. How to implement smooth scaling in UIScrollView?

+3
source share
2 answers

I would try to display your content in a bitmap when scrolling or zooming and replace the large grid of buttons with a bitmap until scrolling / scaling is complete. The UIScrollViewDelegate protocol should provide you with the necessary information to know when to change the bitmap. Part of the problem is that viewing content is so intensively computed for rendering (all of these buttons).

A more sophisticated approach would be to reimplement your game grid at a lower level using CoreAnimation and more fundamental handling of touch events, but this might be redundant if the bitmap hack works quite well.

+1
source

, ? , iPhone . Safari , Safari -, . , , .

[http://stackoverflow.com/questions/1098234/optimized-image-loading-in-a-uiscrollview] , - , .

0

Source: https://habr.com/ru/post/1724349/


All Articles