简体   繁体   中英

animating multiple textviews

whats the best way to accomplish the following,

I need to update these textivews from lets say 0 to 1000 simultaneously, but it has to seem like the textview is counting up. You know like a count down animation. Except it goes from a specific value to a higher value. I tried running multiple threads and updating the textviews but I don't think is a good approach, I also used a thread executor.

textview 1 - 0 - 100 | textview 2 - 0 - 300 | textview 3 - 0 - 600 | textview 4 - 0 - 100 |

Have you checked out the Chronometer class? It's a pretty basic class, extending TextView , that uses a simple Handler with sendMessageDelayed to update the value. See the method updateRunning() in the source.

代替线程,您应该尝试Handler,在处理程序的postDelayed方法中,您可以传递可运行的代码以执行代码以更新textview,并再次安排处理程序以进行下一个postDelayed执行。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM