继承ViewGroup学习onMeasure和onLayout
在继承ViewGroup类时,需要重写两个方法,分别是onMeasure和onLayout。1,在方法onMeasure中调用setMeasuredDimension方法void android.view.View.setMeasuredDimension(int measuredWidth, int measuredHeight)在onMeasure(int, int)中,必须调用setMeasuredDimension(int width, int height)来存储测量得到的宽度和高度值