int w = View.MeasureSpec.makeMeasureSpec(0,
View.MeasureSpec.UNSPECIFIED);
int h = View.MeasureSpec.makeMeasureSpec(0,
View.MeasureSpec.UNSPECIFIED);
relativeLayout.measure(w, h);
height = relativeLayout.getMeasuredHeight();
为了获取某个控件的高度,直接getHeight为0的情况下使用
最新推荐文章于 2021-05-26 11:39:36 发布