1. 程式人生 > >自定義ViewGroup繪製筆記

自定義ViewGroup繪製筆記

1、onMeasure(....)

//迴圈計算child view measureChild(getChildViewAt(i),x,x);

 h = getChildViewAt(i).getMeasuredHeight();

//計運算元view的w h 設定本身

setMeasureDimension (w,h)

2、onLayout() 佈局view 位置 child.layout(.....);