onMeasure 에서 setMeasuredDimension 으로 지정 합니다.
android full src 에 launcher 소스를 분석해보세요
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec);
int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec);
// todo child view
setMeasuredDimension(widthSpecSize, heightSpecSize);
}