Android的view组件显示主要经过mesure, layout和draw这三个过程.在mesure阶段里调用mesure(int widthSpec, int heightSpec)方法,这个方法是final不能被重写,在这个过程里会调用onMesure(int widthSpec, int heightSpec)方法.当组件设置好大小后,调用finallayout(int l, int t, int r, int b)方法进行布局,在这个过程里会调用onLayout(boolean ch…
protected void onAttachedToWindow() 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 onDraw(android.graphics.Canvas), however it…