开发者

Animating multiple UIVIew cause problems

开发者 https://www.devze.com 2022-12-19 05:56 出处:网络
In my current iPhone game project I am using UIView that are some game play elements (they are tiles).Animating one by one is working well, or in a small series (5 UIView animating at the same time).

In my current iPhone game project I am using UIView that are some game play elements (they are tiles). Animating one by one is working well, or in a small series (5 UIView animating at the same time).

But once I decided to animate those same UIView more massively together I am starting to get some weird rendering issue (the whole iPod touch screen turning black then flashing back to the game view once the animation is done or nearly done, in othe开发者_StackOverflowr case the screen is flickering between black and the actual game view while it's trying to animate).

I've done several test and so far its seems that up to 18 UIView being animated I don't have any issue, but once I get to 30 UIView I am seeing this rendering problems. And the animation transition I am using is the the Flip from right.

Is there a maxiumum of animation thread that can be run at once?

I am calling a method on my subclass UIView which do the standard begin animation commit animations. And I am setting the cache to YES.

Any ideas what could be the cause of the rendering bug?

Thanks for your collaboration in advance.


There is not an explicit maximum of animations that can run at the same time.

But, every animation will use memory and CPU usage. This of course greatly depends on the kind of animation you are doing.

So you are probably trying to do too much animation at the same time.

Using the UIView animation is great for many thing, but sometimes you have to use something more appropriate like OpenGL. Maybe you are in that situation.


You may be running into memory issues, or GPU limits, if trying to do a lot with UIView animations. You MAY want to try doing this with layers, but there are limits to what the GPU can handle.

0

精彩评论

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

关注公众号