开发者

How fast invalidate refreshers the canvas?

开发者 https://www.devze.com 2023-03-11 06:56 出处:网络
if i call invlidate() at the end of onDraw() function开发者_运维问答 in a View, at what rate does the system refreshers?.

if i call invlidate() at the end of onDraw() function开发者_运维问答 in a View, at what rate does the system refreshers?.

In emulator it takes around 1 second to call the method.


What are you using the canvas for? If you're doing a game or something that needs to be refreshed constantly you should really use a SurfaceView. That will take care of calling the draw method at regular intervals without you having to call invalidate. That said the refresh rate of a SurfaceView really depends on what you're drawing. If all you're doing is clearing it then it can do many hundreds of frames per second.

0

精彩评论

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