postInvalidate,postInvalidateDelayed,invalidate
来源:互联网 发布:国际学校知乎 编辑:程序博客网 时间:2024/06/16 07:48
传承者(Inheritors)
刷新UI
postInvalidate()其实内部调用的是postInvalidateDelayed(0),也就是不延迟
/** * <p>Cause an invalidate to happen on a subsequent cycle through the event loop. * Use this to invalidate the View from a non-UI thread.</p> * * <p>This method can be invoked from outside of the UI thread * only when this View is attached to a window.</p> * * @see #invalidate() * @see #postInvalidateDelayed(long) */ public void postInvalidate() { postInvalidateDelayed(0); }
/** * <p>Cause an invalidate to happen on a subsequent cycle through the event * loop. Waits for the specified amount of time.</p> * * <p>This method can be invoked from outside of the UI thread * only when this View is attached to a window.</p> * * @param delayMilliseconds the duration in milliseconds to delay the * invalidation by * * @see #invalidate() * @see #postInvalidate() */ public void postInvalidateDelayed(long delayMilliseconds) { // We try only with the AttachInfo because there's no point in invalidating // if we are not attached to our window final AttachInfo attachInfo = mAttachInfo; if (attachInfo != null) { attachInfo.mViewRootImpl.dispatchInvalidateDelayed(this, delayMilliseconds); } }
invalidate 内部调用的是invalidate(true)
/** * Invalidate the whole view. If the view is visible, * {@link #onDraw(android.graphics.Canvas)} will be called at some point in * the future. * <p> * This must be called from a UI thread. To call from a non-UI thread, call * {@link #postInvalidate()}. */ public void invalidate() { invalidate(true); }
0 0
- postInvalidate,postInvalidateDelayed,invalidate
- invalidate() postInvalidate()
- invalidate和postInvalidate
- invalidate和postinvalidate
- invalidate和postInvalidate区别
- invalidate()和postinvalidate()区别
- invalidate()与postInvalidate()
- Invalidate和postInvalidate
- invalidate,postInvalidate区别?
- invalidate、postInvalidate的区别
- Android invalidate 与postInvalidate用法
- Android invalidate 与postInvalidate用法
- Android invalidate与postInvalidate用法
- Invalidate和postInvalidate的区别
- Invalidate和postInvalidate的区别
- invalidate()和postInvalidate() 的区别
- Invalidate和postInvalidate的区别
- Invalidate和postInvalidate的区别
- margin重叠深究
- linux内核之C语言字符串操作函数集
- Time::HiRes, sleep(), time()
- MySQL提示“too many connections”的解决办法
- 118. Pascal's Triangle&&119. Pascal's Triangle II
- postInvalidate,postInvalidateDelayed,invalidate
- SNMP4J
- 自定义Preference中设置其中TextView,等widget方法
- sizeof和strlen的区别
- Android学习系列(12)--App列表之拖拽GridView
- scrollview嵌套listview运行后最先显示出来的位置不在顶部而是中间问题
- Android Studio教程 基本设置与运行
- SVN安装及使用说明
- 遇到问题一定要先上 Stack Overflow 去找!!!