系统绘制时候 第一步会判断是否忽略绘制。 /** * Do not invalidate views which are not visible and which are not running an animation. They * will not get drawn and they should not set dirty flags as if they will be drawn */ private boolean skipInvalidate() { return (mViewFlags & VISIBILITY_MASK) != VISIBLE && mCurrentAnimation == null && (!(mParent instanceof ViewGroup) || !((ViewGroup) mParent).isViewTransitioning(this)); }可能原因 有两个 1 你的threadSleep 间隔太短了, 系统忽略掉之前的绘制请求,采用最后一个。 2 你调用 handler.post(mUpdateResults); 时候 控件还未完全本身的绘制。即 你是不是在Activity的create中调用?
* Do not invalidate views which are not visible and which are not running an animation. They
* will not get drawn and they should not set dirty flags as if they will be drawn
*/
private boolean skipInvalidate() {
return (mViewFlags & VISIBILITY_MASK) != VISIBLE && mCurrentAnimation == null &&
(!(mParent instanceof ViewGroup) ||
!((ViewGroup) mParent).isViewTransitioning(this));
}可能原因 有两个 1 你的threadSleep 间隔太短了, 系统忽略掉之前的绘制请求,采用最后一个。
2 你调用 handler.post(mUpdateResults); 时候 控件还未完全本身的绘制。即 你是不是在Activity的create中调用?