80,337
社区成员
发帖
与我相关
我的任务
分享
public class MyView extends View {
private static int index=0;
public MyView(Context context, AttributeSet attrs) {
super(context, attrs);
log("create MyView");
}
private void log(String msg) {
Log.d("chen","index="+(index++)+"- -"+msg);
}
@Override
public void requestLayout() {
super.requestLayout();
log("requestLayout");
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
log("onMeasure");
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
log("onLayout");
}
}