View v;v.measure(0, 0); totalHeight += v.getMeasuredHeight(); // 计算子项View 的宽高把每个layout都算完了再加起来totalHeight就是ScrollView的高度。