Android ViewGroup ticker

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 19:58:04

问题


I am developing an Android component that has the same functionality as a news Ticker. It's a ViewGroup that takes an array of Views and animate them to create the effect of a Ticker.

I have implemented the onMeasure and onLayout methods, and I have a timer that calls a method every X time to refresh the position of every View. It basically moves the position of every child by 5 pixels lets say.

Everything is working great so far, but the problem is that a few seconds after the Views start moving, they start to overlap on each others, as if some of them are going faster than others. I am moving all the Views with the same amount of pixels so they should be moving at the same speed. This problem only occurs on some devices (like the Galaxy SIII) and just works fine on others.

Any idea why this is happening?

来源:https://stackoverflow.com/questions/13162888/android-viewgroup-ticker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!