We have an application that generates around 100 animations at runtime and they are all added to a single storyboard and then play开发者_运维技巧ed. The problem is that the animation is extremely slow. The objects that are being animated are shapes and splines and a good amount of computation is done in the backend for generating the custom splines. The running computer is a quad core with a good graphics card.
Any suggestions on how we can fix this? Do we need to split the animations into multiple storyboards or animate on different canvases?
Thank you
Its little difficult to know whats slowing down your animation without seeing animation and code. But I will give you general points that can help improving them.
- Move your calculation into different thread, if there is very heavy calculation. Dispatcher thread is busy doing your UI management so if you put everything into one thread that will certainly slow down things.
- Reuse your splines,shapes etc, this will certainly help you because you will also free your app from costly garbage collection routines. Infact before starting animation, display some different animation like clock etc to create all objects required in the beginning.
- Explore bitmap caching options and try to implement them.
精彩评论