开发者

Android animation slows down

I have a continuous frame animation which runs 24 frames per X seconds, which is working fine, Now when i run another two animations ( Alpha animation ) at the same time , i notice performance drop , that is frame animation slows down.

Any idea why this is happening, and is there any wo开发者_开发技巧rk around for this?

Thanks in advance.


I'd say that you code in inefficient and the phone can't handle it. If you provide the code I'm sure people can look over it and find where the inefficiencies might be.

Also, is this on a phone or the emulator?


Make sure you are using hardware layers to make your animation run smoothly.

You may have enabled hardware acceleration but that is not enough, you still need to use hardware layers on the views that you are animating get the best performance.

Use view.setLayerType to put the view into a hardware texture for the duration of the animation.

I just wrote a blog post about this, here: http://www.innodroid.com/blog/post/using-hardware-layers-for-complex-animations

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜