AndroidカスタマイズViewでよく使われる方法の簡単な紹介

1725 ワード

カスタムviewでよく使われるメソッドを記録します
onFocusChanged(boolean, int, Rect)  View          

onWindowFocusChanged(boolean)       view          

onAttachedToWindow()  view           

onDetachedFromWindow()  view          ,     onAttachedToWindow()    。

onWindowVisibilityChanged(int)           view       onFinishInflate()  View            xml   

onMeasure(int, int)           

onLayout(boolean, int, int, int, int)  View                 

onSizeChanged(int, int, int, int)  view          

onDraw(Canvas) view       

onKeyDown(int, KeyEvent)         

onKeyUp(int, KeyEvent)            

onTouchEvent(MotionEvent)