在继承ViewGroup类时,需要重写两个方法,分别是onMeasure和onLayout。1,在方法onMeasure中调用setMeasuredDimension方法voidandroid.view.View.setMeasuredDimension(intmeasuredWidth,intmeasuredHeight)在onMeasure(int,int)中,必须调用setMeasuredDimension(intwidth,intheight)来存储测量得到的宽度和高度值...
查看全文