您的位置:首页 > 其它

View 生命周期方法

2014-12-09 15:05 162 查看
/**

* This is called when the view is attached to a window. At this point it

* has a Surface and will start drawing. Note that this function is

* guaranteed to be called before {@link #onDraw(android.graphics.Canvas)},

* however it may be called any time before the first onDraw -- including

* before or after {@link #onMeasure(int, int)}.

*

* @see #onDetachedFromWindow()

*/

onAttachedToWindow() //关联到window时调用

/**

* This is called when the view is detached from a window. At this point it

* no longer has a surface for drawing.

*

* @see #onAttachedToWindow()

*/

onDetachedFromWindow() //从window中分离出来时调用,做资源缩放的相关操作
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: