获取header布局的高度的方法可以简化为:
int headerHeight;
// 测量View
header.measure(ViewGroup.LayoutParms.MATHC_PARENT, ViewGroup.LayoutParms.WRAP_CONTENT);
// 获取View高度
headerHeight = header.getMesuredHeight();
int headerHeight;
// 测量View
header.measure(ViewGroup.LayoutParms.MATHC_PARENT, ViewGroup.LayoutParms.WRAP_CONTENT);
// 获取View高度
headerHeight = header.getMesuredHeight();
2015-11-07