in onLayout, header.getHeight() may return 0, use LayoutParams.height instead.