@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int viewHeight = 0; View childView = getChildAt(getCurrentItem()); if(childView != null) //有可能没有子view { childView.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED)); viewHeight = childView.getMeasuredHeight(); //得到父元素对自身设定的高 heightMeasureSpec = MeasureSpec.makeMeasureSpec(viewHeight, MeasureSpec.EXACTLY); } super.onMeasure(widthMeasureSpec, heightMeasureSpec); }
android PullToRefreshScrollView中 嵌套viewpage 解决不显示的问题
最新推荐文章于 2025-05-27 11:46:21 发布